Spaces:
Paused
Paused
siddeshwar-kagatikar commited on
Commit Β·
274f638
1
Parent(s): 9e3e5ff
Document all Space variables and secrets in README
Browse files
README.md
CHANGED
|
@@ -356,6 +356,48 @@ Example test command against the deployed Space:
|
|
| 356 |
API_BASE_URL=https://api.openai.com/v1 MODEL_NAME=gpt-5.4-mini OPENAI_API_KEY=your_key SPACE_URL=https://siddeshwar1625-osint.hf.space python inference.py
|
| 357 |
```
|
| 358 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
## Docker And Hugging Face Space
|
| 360 |
|
| 361 |
The repository is ready for a Docker-based Hugging Face Space:
|
|
|
|
| 356 |
API_BASE_URL=https://api.openai.com/v1 MODEL_NAME=gpt-5.4-mini OPENAI_API_KEY=your_key SPACE_URL=https://siddeshwar1625-osint.hf.space python inference.py
|
| 357 |
```
|
| 358 |
|
| 359 |
+
## Hugging Face Space β Variables And Secrets
|
| 360 |
+
|
| 361 |
+
All settings below are read by `server.py`, `scripts/space_start.sh`, and `src/osint_env/training/self_play.py` at Space boot. Configure them under **Settings β Variables and secrets** on the Space. Secrets are stored encrypted; plain variables are visible in the UI.
|
| 362 |
+
|
| 363 |
+
### Secrets (sensitive β store as **Secrets**)
|
| 364 |
+
|
| 365 |
+
- `HF_TOKEN` β Hugging Face auth token used for downloading gated models and uploading checkpoints to your model repo (aliases also accepted: `HUGGINGFACE_HUB_TOKEN`, `HUGGING_FACE_HUB_TOKEN`).
|
| 366 |
+
- `WANDB_API_KEY` β Weights & Biases API key; enables remote training dashboards (loss, KL, reward curves) during self-play.
|
| 367 |
+
- `OPENAI_API_KEY` β OpenAI key used by `inference.py` and the OpenAI baseline; only required when the LLM provider is `openai`.
|
| 368 |
+
|
| 369 |
+
### Server / runtime variables
|
| 370 |
+
|
| 371 |
+
- `PORT` β Port uvicorn binds to (default `7860`; HF sets this automatically).
|
| 372 |
+
- `OSINT_ENV_CONFIG` β Path to the shared environment config JSON (default `datasets/fixed_levels/shared_config_fixed_levels.json`).
|
| 373 |
+
- `OSINT_ENV_SEED_FILE` β Path to the fixed-task seed file used by the live Space (default `datasets/fixed_levels/seed_fixed_levels.json`).
|
| 374 |
+
- `OSINT_SPACE_LLM_PROVIDER` β LLM provider for the live demo and `/api/environment` (default `mock`; set `openai` to use a real model).
|
| 375 |
+
- `OSINT_SPACE_LLM_MODEL` β Model name when provider is `openai` (default `gpt-4o-mini`).
|
| 376 |
+
|
| 377 |
+
### Self-play training (boot-time) variables
|
| 378 |
+
|
| 379 |
+
- `RUN_SELF_PLAY_TRAINING` β `1` to run self-play training on Space boot, `0` to skip (default `1`).
|
| 380 |
+
- `RUN_SELF_PLAY_DRY_RUN` β `1` materializes artifacts without GRPO updates; useful for verifying wiring (default `0`).
|
| 381 |
+
- `RUN_SPACE_API_SERVER` β `1` to start uvicorn alongside training, `0` for training-only mode (default `1`).
|
| 382 |
+
- `TRAIN_SELF_PLAY_CONFIG_PATH` β Training config JSON (default `config/self_play_training_hf_l40s_full.json`).
|
| 383 |
+
- `TRAIN_ENV_CONFIG_PATH` β Environment config consumed by the training run (default `config/shared_config.json`).
|
| 384 |
+
- `TRAIN_SELF_PLAY_OUTPUT_DIR` β Override for where training artifacts and checkpoints are written.
|
| 385 |
+
- `TRAIN_LOG_PATH` β File the supervised training process writes stdout/stderr to (default `/tmp/self_play_training.log`).
|
| 386 |
+
- `OSINT_TRAIN_STRICT_ASSERTS` β `1` makes training fail fast when reward variance, KL, loss, grad norms, or parameter updates stay zero (default off).
|
| 387 |
+
|
| 388 |
+
### Checkpoint upload (HF Hub) variables
|
| 389 |
+
|
| 390 |
+
- `OSINT_HF_CHECKPOINT_REPO_ID` β Force checkpoint uploads into a specific HF model repo (e.g. `Siddeshwar1625/osint-checkpoints-final`). When unset, a name is derived from `SPACE_ID`.
|
| 391 |
+
- `OSINT_HF_CHECKPOINT_REPO_TYPE` β Repo type for uploads (`model` by default; can be `dataset`).
|
| 392 |
+
- `OSINT_HF_CHECKPOINT_REPO_PRIVATE` β `0` to create/update a public checkpoint repo (default `1`/private).
|
| 393 |
+
- `OSINT_HF_CHECKPOINT_REPO_SUFFIX` β Suffix appended when the repo name is derived from `SPACE_ID` (default `-checkpoints`).
|
| 394 |
+
- `OSINT_HF_CHECKPOINT_PATH_PREFIX` β Subdirectory inside the repo where checkpoints are written.
|
| 395 |
+
- `OSINT_HF_UPLOAD_ON_SAVE` β `0` disables automatic upload of every new `checkpoint-*` directory (default `1`).
|
| 396 |
+
|
| 397 |
+
### Auto-populated by the Space (read-only)
|
| 398 |
+
|
| 399 |
+
- `SPACE_ID` / `HF_SPACE_ID` β Set by Hugging Face; consumed when deriving a default checkpoint repo name.
|
| 400 |
+
|
| 401 |
## Docker And Hugging Face Space
|
| 402 |
|
| 403 |
The repository is ready for a Docker-based Hugging Face Space:
|