Views
No views yet

1# 1. Install uv
2curl -LsSf https://astral.sh/uv/install.sh | sh
3
4# 2. Clone
5git clone https://huggingface.co/raazkumar/storybox-reproduction
6cd storybox-reproduction
7
8# 3. Install dependencies (uv handles everything)
9uv sync
10
11# 4. Run quick test (1 day, mock LLM — no API key needed)
12uv run python reverie/test_run.py
13
14# 5. Run full simulation (14 days, requires API key)
15export OPENAI_API_KEY="sk-..."
16uv run python reverie/run.py1# Base install (OpenAI only)
2uv sync
3
4# Apple Silicon — native MLX (fastest on M1/M2/M3/M4)
5uv sync --extra mlx
6
7# NVIDIA NIM inference
8uv sync --extra nim
9
10# Ollama local inference
11uv sync --extra ollama
12
13# All local backends (MLX + Ollama)
14uv sync --extra local
15
16# Everything (all providers + dev tools)
17uv sync --extra all --extra dev| Provider | Config | Speed | Setup |
|---|---|---|---|
| OpenAI | gpt-4o-mini | Fastest | API key |
| Ollama | gemma4 | Fast | brew install ollama |
| MLX (Apple) ⭐ | llama3.1-8b-mlx | Fastest on Mac | uv sync --extra mlx |
| NVIDIA NIM | nvidia/meta/llama-3.1-8b-instruct | Fast | API key |
reverie/config/config.py:1llm_model_name = 'llama3.1-8b-mlx' # MLX native (Apple)
2llm_model_name = 'gemma4' # Ollama
3llm_model_name = 'nvidia/meta/llama-3.1-8b-instruct' # NIM
4llm_model_name = 'gpt-4o-mini' # OpenAIstorybox/
├── reverie/
│ ├── run.py # Main entry point
│ ├── test_run.py # Quick 1-day test
│ ├── config/config.py # All settings
│ ├── agent/storyteller.py # Story generation
│ ├── persona/ # Characters + cognition
│ ├── environment/world.py # Sandbox world
│ ├── common/llm.py # LLM provider router
│ ├── common/mlx_llm.py # Native MLX (Apple)
│ └── prompts/prompt-1/ # 30+ prompt templates
├── data/story01-20/ # 20 story settings
├── pyproject.toml # uv project config
└── uv.lock # Locked dependencies1# Run with uv (recommended)
2uv run python reverie/run.py
3uv run python reverie/test_run.py
4
5# Install additional dependencies
6uv add gradio
7uv add --dev pytest
8
9# Lock dependencies
10uv lock
11
12# Update dependencies
13uv sync --upgrade
14
15# Run tests
16uv run pytest
17
18# Format code
19uv run ruff format .
20uv run ruff check --fix .
21
22# Type check
23uv run mypy reverie/1# Generate English story
2uv run python reverie/run.py
3
4# Translate to Hindi (post-generation)
5# See GRADIO_UI_GUIDE.md for full pipeline1# Generate 1000 stories for training data
2uv run python scripts/generate_synthetic_dataset.py \
3 --num-stories 1000 \
4 --output stories.jsonl
5
6# Convert to instruction format
7uv run python scripts/to_instruction_format.py \
8 --input stories.jsonl \
9 --output train.json1@inproceedings{chen2026storybox,
2 title = {StoryBox: Collaborative Multi-Agent Simulation for Hybrid Bottom-Up Long-Form Story Generation Using Large Language Models},
3 author = {Chen, Zehao and Pan, Rong and Li, Haoran},
4 booktitle = {Proceedings of the AAAI Conference on Artificial Intelligence},
5 volume = {40},
6 number = {36},
7 pages = {30359--30367},
8 year = {2026}
9}1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = 'raazkumar/storybox-reproduction'
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)AutoModelForCausalLM with the appropriate AutoModel class.