Spaces:
Running on Zero
Running on Zero
agharsallah commited on
Commit ·
39e9569
1
Parent(s): 7609c9c
feat: update setup instructions and dependencies for uv integration
Browse files- README.md +8 -8
- docs/architecture/next-steps/phase-3-persistence-recovery.md +1 -1
- docs/runbooks/local-dev.md +5 -7
- modal_app.py +3 -2
- requirements-dev.txt +0 -4
- requirements.txt +0 -5
- src/models/openai_compat.py +1 -1
README.md
CHANGED
|
@@ -14,16 +14,16 @@ interactive story engine where the AI is load-bearing for the experience.
|
|
| 14 |
## Quickstart
|
| 15 |
|
| 16 |
```bash
|
| 17 |
-
|
| 18 |
-
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
| 19 |
-
pip install -r requirements.txt
|
| 20 |
|
| 21 |
# Optional: add your API key for live inference
|
| 22 |
cp .env.example .env # then fill in OPENAI_API_KEY
|
| 23 |
|
| 24 |
-
|
| 25 |
```
|
| 26 |
|
|
|
|
|
|
|
| 27 |
The app runs on a **deterministic local stub** with no API key — great for testing
|
| 28 |
and demos that need to be fully reproducible. Add an `OPENAI_API_KEY` to switch to
|
| 29 |
live inference. Any OpenAI-compatible endpoint works (Together AI, Groq, Ollama,
|
|
@@ -32,7 +32,7 @@ NVIDIA NIM) — set `OPENAI_BASE_URL` in `.env`.
|
|
| 32 |
### Run tests
|
| 33 |
|
| 34 |
```bash
|
| 35 |
-
|
| 36 |
```
|
| 37 |
|
| 38 |
---
|
|
@@ -217,9 +217,9 @@ modal_app.py Optional: serverless scheduled run (Modal)
|
|
| 217 |
```bash
|
| 218 |
# 1. Build the thinnest slice
|
| 219 |
# 2. Record the decision
|
| 220 |
-
python -c "from scripts.new_journal_entry import main; main()" "What changed today"
|
| 221 |
# 3. Regenerate the living blog
|
| 222 |
-
|
| 223 |
# 4. Confirm nothing broke
|
| 224 |
-
|
| 225 |
```
|
|
|
|
| 14 |
## Quickstart
|
| 15 |
|
| 16 |
```bash
|
| 17 |
+
uv sync # create .venv and install everything from the lockfile
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Optional: add your API key for live inference
|
| 20 |
cp .env.example .env # then fill in OPENAI_API_KEY
|
| 21 |
|
| 22 |
+
uv run app.py
|
| 23 |
```
|
| 24 |
|
| 25 |
+
> Don't have [uv](https://docs.astral.sh/uv/)? `curl -LsSf https://astral.sh/uv/install.sh | sh`
|
| 26 |
+
|
| 27 |
The app runs on a **deterministic local stub** with no API key — great for testing
|
| 28 |
and demos that need to be fully reproducible. Add an `OPENAI_API_KEY` to switch to
|
| 29 |
live inference. Any OpenAI-compatible endpoint works (Together AI, Groq, Ollama,
|
|
|
|
| 32 |
### Run tests
|
| 33 |
|
| 34 |
```bash
|
| 35 |
+
uv run pytest tests/ -v
|
| 36 |
```
|
| 37 |
|
| 38 |
---
|
|
|
|
| 217 |
```bash
|
| 218 |
# 1. Build the thinnest slice
|
| 219 |
# 2. Record the decision
|
| 220 |
+
uv run python -c "from scripts.new_journal_entry import main; main()" "What changed today"
|
| 221 |
# 3. Regenerate the living blog
|
| 222 |
+
uv run scripts/snapshot_progress.py
|
| 223 |
# 4. Confirm nothing broke
|
| 224 |
+
uv run pytest tests/ -q
|
| 225 |
```
|
docs/architecture/next-steps/phase-3-persistence-recovery.md
CHANGED
|
@@ -145,7 +145,7 @@ embed = ["sentence-transformers>=2.7.0", "numpy>=1.26.0"]
|
|
| 145 |
```
|
| 146 |
|
| 147 |
Not required — falls back to Jaccard if not installed.
|
| 148 |
-
Install with: `
|
| 149 |
|
| 150 |
---
|
| 151 |
|
|
|
|
| 145 |
```
|
| 146 |
|
| 147 |
Not required — falls back to Jaccard if not installed.
|
| 148 |
+
Install with: `uv sync --extra embed`
|
| 149 |
|
| 150 |
---
|
| 151 |
|
docs/runbooks/local-dev.md
CHANGED
|
@@ -3,23 +3,21 @@
|
|
| 3 |
## Start
|
| 4 |
|
| 5 |
```bash
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
pip install -r requirements.txt
|
| 9 |
-
python app.py
|
| 10 |
```
|
| 11 |
|
| 12 |
## Journal
|
| 13 |
|
| 14 |
```bash
|
| 15 |
-
|
| 16 |
-
|
| 17 |
```
|
| 18 |
|
| 19 |
## Checks
|
| 20 |
|
| 21 |
```bash
|
| 22 |
-
python -m compileall app.py src scripts
|
| 23 |
```
|
| 24 |
|
| 25 |
Add formal tests once the first persistent ledger and provider adapters land.
|
|
|
|
| 3 |
## Start
|
| 4 |
|
| 5 |
```bash
|
| 6 |
+
uv sync # create .venv and install from the lockfile
|
| 7 |
+
uv run app.py
|
|
|
|
|
|
|
| 8 |
```
|
| 9 |
|
| 10 |
## Journal
|
| 11 |
|
| 12 |
```bash
|
| 13 |
+
uv run scripts/new_journal_entry.py "Scaffolded walking skeleton"
|
| 14 |
+
uv run scripts/snapshot_progress.py
|
| 15 |
```
|
| 16 |
|
| 17 |
## Checks
|
| 18 |
|
| 19 |
```bash
|
| 20 |
+
uv run python -m compileall app.py src scripts
|
| 21 |
```
|
| 22 |
|
| 23 |
Add formal tests once the first persistent ledger and provider adapters land.
|
modal_app.py
CHANGED
|
@@ -17,10 +17,11 @@ DEFAULT_SCENARIO = "thousand-token-wood"
|
|
| 17 |
TICKS_PER_EPISODE = 60
|
| 18 |
|
| 19 |
# Mount the whole repo (code + config/) so the registry resolves config via the
|
| 20 |
-
# same __file__ logic it uses locally. Deps come from
|
|
|
|
| 21 |
image = (
|
| 22 |
modal.Image.debian_slim()
|
| 23 |
-
.
|
| 24 |
.add_local_dir(
|
| 25 |
".",
|
| 26 |
remote_path="/root",
|
|
|
|
| 17 |
TICKS_PER_EPISODE = 60
|
| 18 |
|
| 19 |
# Mount the whole repo (code + config/) so the registry resolves config via the
|
| 20 |
+
# same __file__ logic it uses locally. Deps come from pyproject.toml (single
|
| 21 |
+
# source of truth, pinned locally by uv.lock).
|
| 22 |
image = (
|
| 23 |
modal.Image.debian_slim()
|
| 24 |
+
.pip_install_from_pyproject("pyproject.toml")
|
| 25 |
.add_local_dir(
|
| 26 |
".",
|
| 27 |
remote_path="/root",
|
requirements-dev.txt
DELETED
|
@@ -1,4 +0,0 @@
|
|
| 1 |
-
-r requirements.txt
|
| 2 |
-
pytest>=8.2.0
|
| 3 |
-
ruff>=0.5.0
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
gradio>=4.44.0
|
| 2 |
-
pydantic>=2.8.0
|
| 3 |
-
python-dotenv>=1.0.1
|
| 4 |
-
openai>=1.40.0
|
| 5 |
-
pyyaml>=6.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/models/openai_compat.py
CHANGED
|
@@ -35,7 +35,7 @@ class OpenAICompatProvider(ModelProvider):
|
|
| 35 |
except ImportError as exc:
|
| 36 |
raise ImportError(
|
| 37 |
"openai package is required for OpenAICompatProvider. "
|
| 38 |
-
"Run:
|
| 39 |
) from exc
|
| 40 |
kwargs: dict = {}
|
| 41 |
if self.base_url:
|
|
|
|
| 35 |
except ImportError as exc:
|
| 36 |
raise ImportError(
|
| 37 |
"openai package is required for OpenAICompatProvider. "
|
| 38 |
+
"Run: uv add openai"
|
| 39 |
) from exc
|
| 40 |
kwargs: dict = {}
|
| 41 |
if self.base_url:
|