CoolFace
Apppublic

DGXAI/driftcall-env

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes
App README

DriftCall — OpenEnv Env Space

OpenEnv-compliant RL environment exposing DriftCall, a voice-first Indic consumer concierge env under schema / policy / pricing / auth drift.

REST surface (OpenEnv v1.0)

MethodPathPurpose
GET/healthzHealth probe (unauthenticated).
POST/resetCreate or recycle a session.
POST/stepAdvance one turn.
GET/stateRead DriftCallState.
POST/closeEvict a session.

All mutating endpoints require:

Authorization: Bearer <DRIFTCALL_ENV_TOKEN>
X-Session-Id:  [A-Za-z0-9_-]{1,64}

Error envelope:

json
{ "error": { "code": "<slug>", "message": "<str>", "request_id": "<asgi-id>" } }

Cache-Control: no-store on every response. Only M5 max_sessions carries Retry-After: 30. No stack traces ever leak.

Action / observation schemas

  • —Action: cells.step_04_models:DriftCallAction
  • —Observation: cells.step_04_models:DriftCallObservation

Reward function

Reward is a scalar in [-1.0, 1.0], computed at episode termination from five independent components, combined → calibrated → clamped:

IDComponentWeightImplementation
R1task_completion0.40cells.step_08_rewards:task_completion
R2drift_detection0.20cells.step_08_rewards:drift_detection
R3constraint_adherence0.20cells.step_08_rewards:constraint_adherence
R4format_compliance0.10cells.step_08_rewards:format_compliance
R5anti_hack_penalty0.10cells.step_08_rewards:anti_hack_penalty

Pipeline:

python
quality        = combine_quality(R1..R5, weights)
brier          = brier_penalty(confidence, R1)
reward_raw     = quality * (1 - brier)
reward         = apply_uncertain_floor(reward_raw, confidence, quality)  # floor=0.50
final         := clamp(reward, -1.0, 1.0)

Hard rule (CLAUDE.md §13): No LLM judge anywhere in this pipeline. Every reward bit traces to deterministic, schema-grounded checks against the episode trace + the (possibly drifted) vendor schemas in data/.

Full spec: docs/modules/rewards.md in the source repo.

Episode params (passed in /reset)

FieldTypeRangeRequired
seedint—no
curriculum_stageint1–3no
language_weightsobject—no
audio_boundary_enabledbool—no

max_turns = 16 per episode.

Build / deploy

bash
# from repo root
bash deploy/env_space/build.sh           # builds deploy/env_space/build/
bash deploy/env_space/build.sh --push    # builds + uploads to HF_SPACE_REPO

# env vars
HF_SPACE_REPO  default: DGXAI/driftcall-env
HF_TOKEN       required for --push

Sources

This Space is built from deploy/env_space/build.sh which rsyncs the canonical sources at the repo root:

  • —app.py — FastAPI / OpenEnv server (786 LOC)
  • —cells/ — importable modules (env, drift injector, rewards, …)
  • —data/ — authored fixtures (briefs, drift patterns, schemas)
  • —Dockerfile — multi-stage CPU image; Kokoro + faster-whisper baked in
  • —openenv.yaml — manifest validated by openenv validate .
  • —requirements.txt — runtime deps (no training stack)

The model + LoRA adapter are not baked into the Space — eval calls reach out to HF Hub for the trained adapter (DGXAI/gemma-3n-e2b-driftcall-lora).