synth-ai 0.2.13.dev2__py3-none-any.whl → 0.2.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of synth-ai might be problematic. Click here for more details.
- examples/README.md +1 -0
- examples/multi_step/SFT_README.md +147 -0
- examples/multi_step/configs/README_verilog_rl.md +77 -0
- examples/multi_step/configs/VERILOG_REWARDS.md +90 -0
- examples/multi_step/configs/VERILOG_RL_CHECKLIST.md +183 -0
- examples/multi_step/configs/crafter_eval_synth_qwen4b.toml +35 -0
- examples/multi_step/configs/crafter_eval_text_only_groq_qwen32b.toml +36 -0
- examples/multi_step/configs/crafter_rl_stepwise_hosted_judge.toml +12 -11
- examples/multi_step/configs/crafter_sft_qwen30b_lora.toml +62 -0
- examples/multi_step/configs/crafter_synth_backend.md +40 -0
- examples/multi_step/configs/verilog_eval_groq_qwen32b.toml +31 -0
- examples/multi_step/configs/verilog_eval_synth_qwen8b.toml +33 -0
- examples/multi_step/configs/verilog_rl_lora.toml +190 -0
- examples/multi_step/convert_traces_to_sft.py +84 -0
- examples/multi_step/judges/crafter_backend_judge.py +220 -0
- examples/multi_step/judges/verilog_backend_judge.py +234 -0
- examples/multi_step/readme.md +48 -0
- examples/multi_step/run_sft_qwen30b.sh +45 -0
- examples/multi_step/verilog_rl_lora.md +218 -0
- examples/qwen_coder/configs/coder_lora_30b.toml +3 -2
- examples/qwen_coder/configs/coder_lora_4b.toml +2 -1
- examples/qwen_coder/configs/coder_lora_small.toml +2 -1
- examples/qwen_vl/BUGS_AND_FIXES.md +232 -0
- examples/qwen_vl/IMAGE_VALIDATION_COMPLETE.md +271 -0
- examples/qwen_vl/IMAGE_VALIDATION_SUMMARY.md +260 -0
- examples/qwen_vl/INFERENCE_SFT_TESTS.md +412 -0
- examples/qwen_vl/NEXT_STEPS_2B.md +325 -0
- examples/qwen_vl/QUICKSTART.md +327 -0
- examples/qwen_vl/QUICKSTART_RL_VISION.md +110 -0
- examples/qwen_vl/README.md +154 -0
- examples/qwen_vl/RL_VISION_COMPLETE.md +475 -0
- examples/qwen_vl/RL_VISION_TESTING.md +333 -0
- examples/qwen_vl/SDK_VISION_INTEGRATION.md +328 -0
- examples/qwen_vl/SETUP_COMPLETE.md +275 -0
- examples/qwen_vl/VISION_TESTS_COMPLETE.md +490 -0
- examples/qwen_vl/VLM_PIPELINE_COMPLETE.md +242 -0
- examples/qwen_vl/__init__.py +2 -0
- examples/qwen_vl/collect_data_via_cli.md +423 -0
- examples/qwen_vl/collect_vision_traces.py +368 -0
- examples/qwen_vl/configs/crafter_rl_vision_qwen3vl4b.toml +127 -0
- examples/qwen_vl/configs/crafter_vlm_sft_example.toml +60 -0
- examples/qwen_vl/configs/eval_gpt4o_mini_vision.toml +43 -0
- examples/qwen_vl/configs/eval_gpt4o_vision_proper.toml +29 -0
- examples/qwen_vl/configs/eval_gpt5nano_vision.toml +45 -0
- examples/qwen_vl/configs/eval_qwen2vl_vision.toml +44 -0
- examples/qwen_vl/configs/filter_qwen2vl_sft.toml +50 -0
- examples/qwen_vl/configs/filter_vision_sft.toml +53 -0
- examples/qwen_vl/configs/filter_vision_test.toml +8 -0
- examples/qwen_vl/configs/sft_qwen3_vl_2b_test.toml +54 -0
- examples/qwen_vl/crafter_gpt5nano_agent.py +308 -0
- examples/qwen_vl/crafter_qwen_vl_agent.py +300 -0
- examples/qwen_vl/run_vision_comparison.sh +62 -0
- examples/qwen_vl/run_vision_sft_pipeline.sh +175 -0
- examples/qwen_vl/test_image_validation.py +201 -0
- examples/qwen_vl/test_sft_vision_data.py +110 -0
- examples/rl/README.md +1 -1
- examples/rl/configs/eval_base_qwen.toml +17 -0
- examples/rl/configs/eval_rl_qwen.toml +13 -0
- examples/rl/configs/rl_from_base_qwen.toml +37 -0
- examples/rl/configs/rl_from_base_qwen17.toml +76 -0
- examples/rl/configs/rl_from_ft_qwen.toml +37 -0
- examples/rl/run_eval.py +436 -0
- examples/rl/run_rl_and_save.py +111 -0
- examples/rl/task_app/README.md +22 -0
- examples/rl/task_app/math_single_step.py +990 -0
- examples/rl/task_app/math_task_app.py +111 -0
- examples/sft/README.md +5 -5
- examples/sft/configs/crafter_fft_qwen0p6b.toml +4 -2
- examples/sft/configs/crafter_lora_qwen0p6b.toml +4 -3
- examples/sft/evaluate.py +4 -4
- examples/sft/export_dataset.py +7 -4
- examples/sft/generate_traces.py +2 -0
- examples/swe/task_app/README.md +1 -1
- examples/swe/task_app/grpo_swe_mini.py +1 -1
- examples/swe/task_app/grpo_swe_mini_task_app.py +0 -12
- examples/swe/task_app/hosted/envs/mini_swe/environment.py +13 -13
- examples/swe/task_app/hosted/policy_routes.py +0 -2
- examples/swe/task_app/hosted/rollout.py +2 -8
- examples/task_apps/IMAGE_ONLY_EVAL_QUICKSTART.md +258 -0
- examples/task_apps/crafter/CREATE_SFT_DATASET.md +273 -0
- examples/task_apps/crafter/EVAL_IMAGE_ONLY_RESULTS.md +152 -0
- examples/task_apps/crafter/FILTER_COMMAND_STATUS.md +174 -0
- examples/task_apps/crafter/FILTER_COMMAND_SUCCESS.md +268 -0
- examples/task_apps/crafter/QUERY_EXAMPLES.md +203 -0
- examples/task_apps/crafter/README_IMAGE_ONLY_EVAL.md +316 -0
- examples/task_apps/crafter/eval_image_only_gpt4o.toml +28 -0
- examples/task_apps/crafter/eval_text_only_groq_llama.toml +36 -0
- examples/task_apps/crafter/filter_sft_dataset.toml +16 -0
- examples/task_apps/crafter/task_app/__init__.py +3 -0
- examples/task_apps/crafter/task_app/grpo_crafter.py +309 -14
- examples/task_apps/crafter/task_app/synth_envs_hosted/envs/crafter/environment.py +10 -0
- examples/task_apps/crafter/task_app/synth_envs_hosted/envs/crafter/policy.py +75 -4
- examples/task_apps/crafter/task_app/synth_envs_hosted/envs/crafter/react_agent.py +17 -2
- examples/task_apps/crafter/task_app/synth_envs_hosted/inference/openai_client.py +55 -3
- examples/task_apps/crafter/task_app/synth_envs_hosted/policy_routes.py +114 -32
- examples/task_apps/crafter/task_app/synth_envs_hosted/rollout.py +127 -27
- examples/task_apps/crafter/task_app/synth_envs_hosted/utils.py +156 -0
- examples/task_apps/enron/__init__.py +1 -0
- examples/task_apps/enron/filter_sft.toml +5 -0
- examples/task_apps/enron/tests/__init__.py +2 -0
- examples/task_apps/enron/tests/integration/__init__.py +2 -0
- examples/task_apps/enron/tests/integration/test_enron_eval.py +2 -0
- examples/task_apps/enron/tests/unit/__init__.py +2 -0
- examples/task_apps/pokemon_red/EVAL_IMAGE_ONLY_COMPLETE.md +283 -0
- examples/task_apps/pokemon_red/EVAL_IMAGE_ONLY_STATUS.md +155 -0
- examples/task_apps/pokemon_red/README_IMAGE_ONLY_EVAL.md +415 -0
- examples/task_apps/pokemon_red/eval_image_only_gpt4o.toml +29 -0
- examples/task_apps/pokemon_red/pallet_town_rl_config.toml +2 -0
- examples/task_apps/pokemon_red/task_app.py +199 -6
- examples/task_apps/pokemon_red/test_pallet_town_rewards.py +2 -0
- examples/task_apps/sokoban/filter_sft.toml +5 -0
- examples/task_apps/sokoban/tests/__init__.py +2 -0
- examples/task_apps/sokoban/tests/integration/__init__.py +2 -0
- examples/task_apps/sokoban/tests/unit/__init__.py +2 -0
- examples/task_apps/verilog/eval_groq_qwen32b.toml +8 -4
- examples/task_apps/verilog/filter_sft.toml +5 -0
- examples/task_apps/verilog/task_app/grpo_verilog.py +258 -23
- examples/task_apps/verilog/tests/__init__.py +2 -0
- examples/task_apps/verilog/tests/integration/__init__.py +2 -0
- examples/task_apps/verilog/tests/integration/test_verilog_eval.py +2 -0
- examples/task_apps/verilog/tests/unit/__init__.py +2 -0
- examples/vlm/README.md +3 -3
- examples/vlm/configs/crafter_vlm_gpt4o.toml +2 -0
- examples/vlm/crafter_openai_vlm_agent.py +3 -5
- examples/vlm/filter_image_rows.py +1 -1
- examples/vlm/run_crafter_vlm_benchmark.py +2 -2
- examples/warming_up_to_rl/_utils.py +92 -0
- examples/warming_up_to_rl/analyze_trace_db.py +1 -1
- examples/warming_up_to_rl/configs/crafter_fft.toml +2 -0
- examples/warming_up_to_rl/configs/crafter_fft_4b.toml +2 -0
- examples/warming_up_to_rl/configs/eval_fft_qwen4b.toml +2 -0
- examples/warming_up_to_rl/configs/eval_groq_qwen32b.toml +2 -0
- examples/warming_up_to_rl/configs/eval_modal_qwen4b.toml +2 -1
- examples/warming_up_to_rl/configs/rl_from_base_qwen4b.toml +2 -1
- examples/warming_up_to_rl/configs/rl_from_ft.toml +2 -0
- examples/warming_up_to_rl/export_trace_sft.py +174 -60
- examples/warming_up_to_rl/groq_test.py +2 -0
- examples/warming_up_to_rl/readme.md +63 -132
- examples/warming_up_to_rl/run_fft_and_save.py +1 -1
- examples/warming_up_to_rl/run_local_rollout.py +2 -0
- examples/warming_up_to_rl/run_local_rollout_modal.py +2 -0
- examples/warming_up_to_rl/run_local_rollout_parallel.py +2 -0
- examples/warming_up_to_rl/run_local_rollout_traced.py +2 -0
- examples/warming_up_to_rl/run_rl_and_save.py +1 -1
- examples/warming_up_to_rl/run_rollout_remote.py +2 -0
- examples/warming_up_to_rl/task_app/README.md +42 -0
- examples/warming_up_to_rl/task_app/grpo_crafter.py +696 -0
- examples/warming_up_to_rl/task_app/grpo_crafter_task_app.py +135 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/README.md +173 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/__init__.py +5 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/branching.py +143 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/environment_routes.py +1226 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/__init__.py +1 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/__init__.py +6 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/app.py +1 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/environment.py +522 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/policy.py +478 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/react_agent.py +108 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/shared.py +305 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/envs/crafter/tools.py +47 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/hosted_app.py +204 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/inference/__init__.py +5 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/inference/openai_client.py +618 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/main.py +100 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/policy_routes.py +1081 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/registry.py +195 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/rollout.py +1861 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/storage/__init__.py +5 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/storage/volume.py +211 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/test_agents.py +161 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/test_service.py +137 -0
- examples/warming_up_to_rl/task_app/synth_envs_hosted/utils.py +62 -0
- synth_ai/__init__.py +44 -30
- synth_ai/_utils/__init__.py +47 -0
- synth_ai/_utils/base_url.py +10 -0
- synth_ai/_utils/http.py +10 -0
- synth_ai/_utils/prompts.py +10 -0
- synth_ai/_utils/task_app_state.py +12 -0
- synth_ai/_utils/user_config.py +10 -0
- synth_ai/api/models/supported.py +145 -7
- synth_ai/api/train/__init__.py +13 -1
- synth_ai/api/train/cli.py +30 -7
- synth_ai/api/train/config_finder.py +18 -11
- synth_ai/api/train/env_resolver.py +13 -10
- synth_ai/cli/__init__.py +66 -49
- synth_ai/cli/_modal_wrapper.py +9 -6
- synth_ai/cli/_typer_patch.py +0 -2
- synth_ai/cli/_validate_task_app.py +22 -4
- synth_ai/cli/legacy_root_backup.py +3 -1
- synth_ai/cli/lib/__init__.py +10 -0
- synth_ai/cli/lib/task_app_discovery.py +7 -0
- synth_ai/cli/lib/task_app_env.py +518 -0
- synth_ai/cli/recent.py +1 -0
- synth_ai/cli/setup.py +266 -0
- synth_ai/cli/task_app_deploy.py +16 -0
- synth_ai/cli/task_app_list.py +25 -0
- synth_ai/cli/task_app_modal_serve.py +16 -0
- synth_ai/cli/task_app_serve.py +18 -0
- synth_ai/cli/task_apps.py +392 -141
- synth_ai/cli/train.py +18 -0
- synth_ai/cli/tui.py +62 -0
- synth_ai/demos/__init__.py +10 -0
- synth_ai/demos/core/__init__.py +28 -1
- synth_ai/demos/crafter/__init__.py +1 -0
- synth_ai/demos/crafter/crafter_fft_4b.toml +55 -0
- synth_ai/demos/crafter/grpo_crafter_task_app.py +185 -0
- synth_ai/demos/crafter/rl_from_base_qwen4b.toml +74 -0
- synth_ai/demos/demo_registry.py +176 -0
- synth_ai/demos/demo_task_apps/crafter/grpo_crafter_task_app.py +1 -1
- synth_ai/demos/math/__init__.py +1 -0
- synth_ai/demos/math/_common.py +16 -0
- synth_ai/demos/math/app.py +38 -0
- synth_ai/demos/math/config.toml +76 -0
- synth_ai/demos/math/deploy_modal.py +54 -0
- synth_ai/demos/math/modal_task_app.py +702 -0
- synth_ai/demos/math/task_app_entry.py +51 -0
- synth_ai/environments/environment/core.py +7 -1
- synth_ai/environments/examples/bandit/engine.py +0 -1
- synth_ai/environments/examples/bandit/environment.py +0 -1
- synth_ai/environments/examples/crafter_classic/environment.py +1 -1
- synth_ai/environments/examples/verilog/engine.py +76 -10
- synth_ai/environments/examples/wordle/environment.py +0 -1
- synth_ai/evals/base.py +16 -5
- synth_ai/evals/client.py +1 -1
- synth_ai/inference/client.py +1 -1
- synth_ai/learning/client.py +1 -1
- synth_ai/learning/health.py +1 -1
- synth_ai/learning/jobs.py +1 -1
- synth_ai/learning/rl/client.py +1 -1
- synth_ai/learning/rl/env_keys.py +1 -1
- synth_ai/learning/rl/secrets.py +1 -1
- synth_ai/learning/sft/client.py +1 -1
- synth_ai/learning/sft/data.py +407 -4
- synth_ai/learning/validators.py +4 -1
- synth_ai/task/__init__.py +11 -1
- synth_ai/task/apps/__init__.py +5 -2
- synth_ai/task/config.py +259 -0
- synth_ai/task/contracts.py +15 -2
- synth_ai/task/rubrics/__init__.py +4 -2
- synth_ai/task/rubrics/loaders.py +27 -4
- synth_ai/task/rubrics/scoring.py +3 -0
- synth_ai/task/rubrics.py +219 -0
- synth_ai/task/trace_correlation_helpers.py +328 -0
- synth_ai/task/tracing_utils.py +14 -3
- synth_ai/task/validators.py +145 -2
- synth_ai/tracing_v3/config.py +15 -13
- synth_ai/tracing_v3/constants.py +21 -0
- synth_ai/tracing_v3/db_config.py +3 -1
- synth_ai/tracing_v3/decorators.py +10 -7
- synth_ai/tracing_v3/session_tracer.py +10 -0
- synth_ai/tracing_v3/turso/daemon.py +2 -2
- synth_ai/tracing_v3/turso/native_manager.py +108 -77
- synth_ai/tracing_v3/utils.py +1 -1
- synth_ai/tui/__init__.py +5 -0
- synth_ai/tui/__main__.py +13 -0
- synth_ai/tui/cli/__init__.py +1 -0
- synth_ai/tui/cli/query_experiments.py +164 -0
- synth_ai/tui/cli/query_experiments_v3.py +164 -0
- synth_ai/tui/dashboard.py +911 -0
- synth_ai/utils/__init__.py +101 -0
- synth_ai/utils/base_url.py +94 -0
- synth_ai/utils/cli.py +131 -0
- synth_ai/utils/env.py +287 -0
- synth_ai/utils/http.py +169 -0
- synth_ai/utils/modal.py +308 -0
- synth_ai/utils/process.py +212 -0
- synth_ai/utils/prompts.py +39 -0
- synth_ai/utils/sqld.py +122 -0
- synth_ai/utils/task_app_discovery.py +882 -0
- synth_ai/utils/task_app_env.py +186 -0
- synth_ai/utils/task_app_state.py +318 -0
- synth_ai/utils/user_config.py +137 -0
- synth_ai/v0/config/__init__.py +1 -5
- synth_ai/v0/config/base_url.py +1 -7
- synth_ai/v0/tracing/config.py +1 -1
- synth_ai/v0/tracing/decorators.py +1 -1
- synth_ai/v0/tracing/upload.py +1 -1
- synth_ai/v0/tracing_v1/config.py +1 -1
- synth_ai/v0/tracing_v1/decorators.py +1 -1
- synth_ai/v0/tracing_v1/upload.py +1 -1
- {synth_ai-0.2.13.dev2.dist-info → synth_ai-0.2.16.dist-info}/METADATA +85 -31
- {synth_ai-0.2.13.dev2.dist-info → synth_ai-0.2.16.dist-info}/RECORD +286 -135
- synth_ai/cli/man.py +0 -106
- synth_ai/compound/cais.py +0 -0
- synth_ai/core/experiment.py +0 -13
- synth_ai/core/system.py +0 -15
- synth_ai/demo_registry.py +0 -295
- synth_ai/handshake.py +0 -109
- synth_ai/http.py +0 -26
- {synth_ai-0.2.13.dev2.dist-info → synth_ai-0.2.16.dist-info}/WHEEL +0 -0
- {synth_ai-0.2.13.dev2.dist-info → synth_ai-0.2.16.dist-info}/entry_points.txt +0 -0
- {synth_ai-0.2.13.dev2.dist-info → synth_ai-0.2.16.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.2.13.dev2.dist-info → synth_ai-0.2.16.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# Pokemon Red Image-Only Evaluation Guide
|
|
2
|
+
|
|
3
|
+
This guide shows you how to run Pokemon Red evaluations with **image-only input** (no text observations) and save traces + rewards to **Turso database**.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
1. **OpenAI API Key**: Set in your `.env` file
|
|
8
|
+
2. **UV Package Manager**: Already installed if you can run `uv run`
|
|
9
|
+
3. **Pokemon Red ROM**: Place in `synth_ai/environments/examples/red/roms/pokemon_red.gb`
|
|
10
|
+
4. **Synth AI Repository**: Clone and set up per main README
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
### 1. Run Image-Only Evaluation (10 Rollouts)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd /Users/joshpurtell/Documents/GitHub/synth-ai
|
|
18
|
+
|
|
19
|
+
# Set up environment for Turso tracing
|
|
20
|
+
export TASKAPP_TRACING_ENABLED=1
|
|
21
|
+
export TURSO_NATIVE=1
|
|
22
|
+
export SQLD_DB_PATH="traces/v3/pokemon_red_eval.db"
|
|
23
|
+
|
|
24
|
+
# Run evaluation with image-only input
|
|
25
|
+
uv run synth-ai eval pokemon_red \
|
|
26
|
+
--config examples/task_apps/pokemon_red/eval_image_only_gpt4o.toml
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Expected output**:
|
|
30
|
+
- 10 rollouts complete
|
|
31
|
+
- Most will stay in Red's bedroom (challenging task!)
|
|
32
|
+
- All traces and rewards saved to `traces/v3/pokemon_red_eval.db`
|
|
33
|
+
|
|
34
|
+
### 2. Check Results
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# View database
|
|
38
|
+
ls -lh traces/v3/pokemon_red_eval.db # Should be ~192KB
|
|
39
|
+
|
|
40
|
+
# Count sessions
|
|
41
|
+
sqlite3 traces/v3/pokemon_red_eval.db \
|
|
42
|
+
"SELECT COUNT(*) FROM session_traces;"
|
|
43
|
+
|
|
44
|
+
# View all rollouts
|
|
45
|
+
sqlite3 -header -column traces/v3/pokemon_red_eval.db \
|
|
46
|
+
"SELECT
|
|
47
|
+
session_id,
|
|
48
|
+
total_reward,
|
|
49
|
+
achievements_count,
|
|
50
|
+
json_extract(reward_metadata, '\$.final_map') as map,
|
|
51
|
+
json_extract(reward_metadata, '\$.party_count') as party
|
|
52
|
+
FROM outcome_rewards
|
|
53
|
+
ORDER BY total_reward DESC;"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 3. Query Statistics
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Get summary stats
|
|
60
|
+
sqlite3 traces/v3/pokemon_red_eval.db \
|
|
61
|
+
"SELECT
|
|
62
|
+
'Total rollouts' as metric, COUNT(*) as value FROM outcome_rewards
|
|
63
|
+
UNION ALL
|
|
64
|
+
SELECT
|
|
65
|
+
'With rewards', COUNT(*) FROM outcome_rewards WHERE total_reward > 0
|
|
66
|
+
UNION ALL
|
|
67
|
+
SELECT
|
|
68
|
+
'Average reward', ROUND(AVG(total_reward), 2) FROM outcome_rewards;"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Configuration File
|
|
72
|
+
|
|
73
|
+
**Location**: `examples/task_apps/pokemon_red/eval_image_only_gpt4o.toml`
|
|
74
|
+
|
|
75
|
+
```toml
|
|
76
|
+
[eval]
|
|
77
|
+
app_id = "pokemon_red"
|
|
78
|
+
model = "gpt-4o-mini-2024-07-18"
|
|
79
|
+
seeds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # 10 rollouts
|
|
80
|
+
max_turns = 10
|
|
81
|
+
concurrency = 1
|
|
82
|
+
env_name = "pokemon_red"
|
|
83
|
+
policy_name = "pokemon_red_policy"
|
|
84
|
+
trace_format = "full"
|
|
85
|
+
return_trace = true
|
|
86
|
+
|
|
87
|
+
[eval.env_config]
|
|
88
|
+
max_steps_per_episode = 10
|
|
89
|
+
|
|
90
|
+
[eval.policy_config]
|
|
91
|
+
provider = "openai"
|
|
92
|
+
model = "gpt-4o-mini-2024-07-18"
|
|
93
|
+
inference_url = "https://api.openai.com"
|
|
94
|
+
temperature = 0.7
|
|
95
|
+
top_p = 0.95
|
|
96
|
+
max_tokens = 512
|
|
97
|
+
use_vision = true # Enable vision mode
|
|
98
|
+
image_only_mode = true # Send ONLY images (no text)
|
|
99
|
+
max_llm_calls = 10
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Key Configuration Options
|
|
103
|
+
|
|
104
|
+
| Option | Description | Values |
|
|
105
|
+
|--------|-------------|--------|
|
|
106
|
+
| `use_vision` | Enable vision/image input | `true` / `false` |
|
|
107
|
+
| `image_only_mode` | Send only images (no text) | `true` / `false` |
|
|
108
|
+
| `seeds` | Which seeds to run | Array of integers |
|
|
109
|
+
| `max_turns` | Max policy calls per rollout | Integer (10-100) |
|
|
110
|
+
| `concurrency` | Parallel rollouts | 1-3 recommended |
|
|
111
|
+
|
|
112
|
+
## Customization
|
|
113
|
+
|
|
114
|
+
### Run More Steps (Recommended for Pokemon Red)
|
|
115
|
+
|
|
116
|
+
Pokemon Red needs more steps to make progress:
|
|
117
|
+
|
|
118
|
+
```toml
|
|
119
|
+
[eval.env_config]
|
|
120
|
+
env_params = {max_steps_per_episode = 500} # Full Pallet Town sequence
|
|
121
|
+
|
|
122
|
+
[eval.policy_config]
|
|
123
|
+
max_llm_calls = 100 # Allow more LLM decisions
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Enable Text + Images (Recommended)
|
|
127
|
+
|
|
128
|
+
Image-only is very challenging for Pokemon Red. Try multimodal:
|
|
129
|
+
|
|
130
|
+
```toml
|
|
131
|
+
[eval.policy_config]
|
|
132
|
+
use_vision = true
|
|
133
|
+
image_only_mode = false # Send both text AND images
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
This gives the model both:
|
|
137
|
+
- Base64-encoded PNG frames (160x144 Game Boy screen)
|
|
138
|
+
- Text state (HP, position, party, inventory, etc.)
|
|
139
|
+
|
|
140
|
+
### Use Better Model
|
|
141
|
+
|
|
142
|
+
```toml
|
|
143
|
+
[eval]
|
|
144
|
+
model = "gpt-4o-2024-08-06" # Full GPT-4o
|
|
145
|
+
|
|
146
|
+
[eval.policy_config]
|
|
147
|
+
model = "gpt-4o-2024-08-06"
|
|
148
|
+
temperature = 0.7 # Slightly higher for exploration
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Run More Episodes
|
|
152
|
+
|
|
153
|
+
```toml
|
|
154
|
+
[eval]
|
|
155
|
+
seeds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] # 20 rollouts
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Database Schema
|
|
159
|
+
|
|
160
|
+
### outcome_rewards Table
|
|
161
|
+
|
|
162
|
+
```sql
|
|
163
|
+
CREATE TABLE outcome_rewards (
|
|
164
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
165
|
+
session_id VARCHAR NOT NULL,
|
|
166
|
+
total_reward INTEGER NOT NULL,
|
|
167
|
+
achievements_count INTEGER NOT NULL, -- Milestone events
|
|
168
|
+
total_steps INTEGER NOT NULL,
|
|
169
|
+
created_at DATETIME NOT NULL,
|
|
170
|
+
reward_metadata TEXT, -- JSON with map_id, party_count, badges, etc.
|
|
171
|
+
FOREIGN KEY(session_id) REFERENCES session_traces(session_id)
|
|
172
|
+
);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Example Queries
|
|
176
|
+
|
|
177
|
+
```sql
|
|
178
|
+
-- Get statistics
|
|
179
|
+
SELECT
|
|
180
|
+
COUNT(*) as total,
|
|
181
|
+
SUM(CASE WHEN total_reward > 0 THEN 1 ELSE 0 END) as with_rewards,
|
|
182
|
+
AVG(total_reward) as avg_reward,
|
|
183
|
+
MAX(total_reward) as max_reward,
|
|
184
|
+
MAX(achievements_count) as max_achievements
|
|
185
|
+
FROM outcome_rewards;
|
|
186
|
+
|
|
187
|
+
-- Find rollouts that made progress
|
|
188
|
+
SELECT
|
|
189
|
+
session_id,
|
|
190
|
+
total_reward,
|
|
191
|
+
achievements_count,
|
|
192
|
+
json_extract(reward_metadata, '$.final_map') as final_map,
|
|
193
|
+
json_extract(reward_metadata, '$.party_count') as party_count,
|
|
194
|
+
json_extract(reward_metadata, '$.badges') as badges
|
|
195
|
+
FROM outcome_rewards
|
|
196
|
+
WHERE total_reward > 0 OR achievements_count > 0
|
|
197
|
+
ORDER BY total_reward DESC;
|
|
198
|
+
|
|
199
|
+
-- Join with session traces
|
|
200
|
+
SELECT
|
|
201
|
+
st.session_id,
|
|
202
|
+
st.created_at,
|
|
203
|
+
st.num_timesteps,
|
|
204
|
+
orw.total_reward,
|
|
205
|
+
orw.achievements_count,
|
|
206
|
+
json_extract(orw.reward_metadata, '$.milestone_events') as milestones
|
|
207
|
+
FROM session_traces st
|
|
208
|
+
INNER JOIN outcome_rewards orw ON st.session_id = orw.session_id
|
|
209
|
+
WHERE orw.total_reward > 0
|
|
210
|
+
ORDER BY orw.total_reward DESC;
|
|
211
|
+
|
|
212
|
+
-- Check which maps were reached
|
|
213
|
+
SELECT
|
|
214
|
+
json_extract(reward_metadata, '$.final_map') as map_id,
|
|
215
|
+
COUNT(*) as count
|
|
216
|
+
FROM outcome_rewards
|
|
217
|
+
GROUP BY map_id
|
|
218
|
+
ORDER BY count DESC;
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Understanding Maps
|
|
222
|
+
|
|
223
|
+
**Common Map IDs**:
|
|
224
|
+
- `38`: Red's bedroom (starting location)
|
|
225
|
+
- `0`: Pallet Town (outside)
|
|
226
|
+
- `40`: Red's house downstairs
|
|
227
|
+
- `37`: Oak's Lab
|
|
228
|
+
|
|
229
|
+
**Goal**: Progress from Map 38 → 40 → 0 → 37 (get starter Pokemon)
|
|
230
|
+
|
|
231
|
+
## Pallet Town Milestones
|
|
232
|
+
|
|
233
|
+
The `PalletTownProgressionCompositeReward` tracks these milestones:
|
|
234
|
+
|
|
235
|
+
| Milestone | Reward | Description |
|
|
236
|
+
|-----------|--------|-------------|
|
|
237
|
+
| Leave bedroom | +20 | Go downstairs |
|
|
238
|
+
| Exit house | +30 | Enter Pallet Town |
|
|
239
|
+
| Find Oak's lab | +40 | Discover and enter lab |
|
|
240
|
+
| Talk to Oak | +50 | First dialogue |
|
|
241
|
+
| Get starter | +100 | Receive your first Pokémon |
|
|
242
|
+
| Enter first battle | +75 | Battle rival |
|
|
243
|
+
| Win battle | +150 | Defeat rival |
|
|
244
|
+
|
|
245
|
+
**Total possible**: ~600+ points
|
|
246
|
+
|
|
247
|
+
## Typical Results
|
|
248
|
+
|
|
249
|
+
**Expected Performance** (10 rollouts, 10 steps, image-only):
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
Total rollouts: 10
|
|
253
|
+
Rollouts with rewards: 0 (0%) ← Expected! Task is hard
|
|
254
|
+
Average reward: 0.0
|
|
255
|
+
Final map: 38 (Red's bedroom)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Why Zero Rewards?**
|
|
259
|
+
- 10 steps is too few for Pokemon Red
|
|
260
|
+
- Image-only mode is very challenging (no HP/inventory text)
|
|
261
|
+
- Needs navigation + NPC interaction
|
|
262
|
+
|
|
263
|
+
**To Get Non-Zero Rewards**:
|
|
264
|
+
1. Increase `max_steps_per_episode` to 100-500
|
|
265
|
+
2. Enable multimodal: `image_only_mode = false`
|
|
266
|
+
3. Use full GPT-4o: `model = "gpt-4o-2024-08-06"`
|
|
267
|
+
|
|
268
|
+
## Troubleshooting
|
|
269
|
+
|
|
270
|
+
### No Database Created
|
|
271
|
+
|
|
272
|
+
**Issue**: `traces/v3/pokemon_red_eval.db` doesn't exist or is 0 bytes
|
|
273
|
+
|
|
274
|
+
**Fix**: Ensure environment variables are set:
|
|
275
|
+
```bash
|
|
276
|
+
export TASKAPP_TRACING_ENABLED=1
|
|
277
|
+
export TURSO_NATIVE=1
|
|
278
|
+
export SQLD_DB_PATH="traces/v3/pokemon_red_eval.db"
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### ROM Not Found
|
|
282
|
+
|
|
283
|
+
**Issue**: `FileNotFoundError: pokemon_red.gb`
|
|
284
|
+
|
|
285
|
+
**Fix**: Place ROM at:
|
|
286
|
+
```bash
|
|
287
|
+
synth_ai/environments/examples/red/roms/pokemon_red.gb
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Or set environment variable:
|
|
291
|
+
```bash
|
|
292
|
+
export POKEMON_RED_ROM_PATH="/path/to/pokemon_red.gb"
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### 401 Unauthorized Error
|
|
296
|
+
|
|
297
|
+
**Issue**: OpenAI API returns 401
|
|
298
|
+
|
|
299
|
+
**Fix**: Check your `.env` file:
|
|
300
|
+
```bash
|
|
301
|
+
# .env
|
|
302
|
+
OPENAI_API_KEY=sk-proj-...your-key-here...
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### All Rewards are Zero
|
|
306
|
+
|
|
307
|
+
**Issue**: Agents aren't making progress (expected with image-only + 10 steps)
|
|
308
|
+
|
|
309
|
+
**Solutions**:
|
|
310
|
+
|
|
311
|
+
1. **Increase steps**:
|
|
312
|
+
```toml
|
|
313
|
+
[eval.env_config]
|
|
314
|
+
env_params = {max_steps_per_episode = 100}
|
|
315
|
+
|
|
316
|
+
[eval.policy_config]
|
|
317
|
+
max_llm_calls = 100
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
2. **Enable text observations**:
|
|
321
|
+
```toml
|
|
322
|
+
[eval.policy_config]
|
|
323
|
+
image_only_mode = false # Send both image AND text
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
3. **Use better model**:
|
|
327
|
+
```toml
|
|
328
|
+
[eval]
|
|
329
|
+
model = "gpt-4o-2024-08-06"
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### PyBoy Not Installed
|
|
333
|
+
|
|
334
|
+
**Issue**: `ModuleNotFoundError: No module named 'pyboy'`
|
|
335
|
+
|
|
336
|
+
**Fix**:
|
|
337
|
+
```bash
|
|
338
|
+
uv add pyboy
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Advanced: Export to CSV
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
# Export all rollouts to CSV
|
|
345
|
+
sqlite3 -header -csv traces/v3/pokemon_red_eval.db \
|
|
346
|
+
"SELECT
|
|
347
|
+
session_id,
|
|
348
|
+
total_reward,
|
|
349
|
+
achievements_count,
|
|
350
|
+
json_extract(reward_metadata, '$.final_map') as final_map,
|
|
351
|
+
json_extract(reward_metadata, '$.party_count') as party_count,
|
|
352
|
+
json_extract(reward_metadata, '$.badges') as badges,
|
|
353
|
+
json_extract(reward_metadata, '$.milestone_events') as milestones
|
|
354
|
+
FROM outcome_rewards
|
|
355
|
+
ORDER BY total_reward DESC" \
|
|
356
|
+
> pokemon_red_rewards.csv
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
## Files Overview
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
examples/task_apps/pokemon_red/
|
|
363
|
+
├── eval_image_only_gpt4o.toml # Config file
|
|
364
|
+
├── EVAL_IMAGE_ONLY_COMPLETE.md # Implementation details
|
|
365
|
+
├── EVAL_IMAGE_ONLY_STATUS.md # Status document
|
|
366
|
+
├── README_IMAGE_ONLY_EVAL.md # This file
|
|
367
|
+
├── task_app.py # Main task app
|
|
368
|
+
│ ├── Image-only mode logic
|
|
369
|
+
│ ├── SessionTracer integration
|
|
370
|
+
│ ├── OpenAI API authentication
|
|
371
|
+
│ └── Reward computation
|
|
372
|
+
└── pallet_town_rl_config.toml # RL training config (reference)
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## Recommended Settings for Success
|
|
376
|
+
|
|
377
|
+
For best chance of non-zero rewards:
|
|
378
|
+
|
|
379
|
+
```toml
|
|
380
|
+
[eval]
|
|
381
|
+
model = "gpt-4o-2024-08-06" # Full GPT-4o
|
|
382
|
+
seeds = [0, 1, 2, 3, 4] # 5 rollouts
|
|
383
|
+
max_turns = 100 # Allow more decisions
|
|
384
|
+
|
|
385
|
+
[eval.env_config]
|
|
386
|
+
env_params = {max_steps_per_episode = 500} # Full episode
|
|
387
|
+
|
|
388
|
+
[eval.policy_config]
|
|
389
|
+
provider = "openai"
|
|
390
|
+
model = "gpt-4o-2024-08-06"
|
|
391
|
+
inference_url = "https://api.openai.com"
|
|
392
|
+
temperature = 0.7
|
|
393
|
+
max_tokens = 512
|
|
394
|
+
use_vision = true # Enable vision
|
|
395
|
+
image_only_mode = false # Send text too (multimodal)
|
|
396
|
+
max_llm_calls = 100
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## See Also
|
|
400
|
+
|
|
401
|
+
- `EVAL_IMAGE_ONLY_COMPLETE.md` - Full implementation details
|
|
402
|
+
- `pallet_town_rl_config.toml` - RL training configuration
|
|
403
|
+
- `../crafter/README_IMAGE_ONLY_EVAL.md` - Crafter version
|
|
404
|
+
|
|
405
|
+
## Summary
|
|
406
|
+
|
|
407
|
+
1. ✅ Set environment variables for Turso tracing
|
|
408
|
+
2. ✅ Run `uv run synth-ai eval pokemon_red --config ...`
|
|
409
|
+
3. ✅ Check database: `traces/v3/pokemon_red_eval.db`
|
|
410
|
+
4. ✅ Query rewards: `SELECT * FROM outcome_rewards`
|
|
411
|
+
5. ✅ For non-zero rewards: increase steps + use multimodal + better model
|
|
412
|
+
|
|
413
|
+
Pokemon Red is challenging - don't be discouraged by zero rewards with image-only + 10 steps! 🎮
|
|
414
|
+
|
|
415
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Evaluation config for Pokemon Red with image-only input
|
|
2
|
+
# This config uses GPT-4o mini with only image data (no text observations)
|
|
3
|
+
|
|
4
|
+
[eval]
|
|
5
|
+
app_id = "pokemon_red"
|
|
6
|
+
model = "gpt-4o-mini-2024-07-18"
|
|
7
|
+
seeds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
|
8
|
+
max_turns = 10
|
|
9
|
+
concurrency = 1 # Keep low initially to avoid issues
|
|
10
|
+
env_name = "pokemon_red"
|
|
11
|
+
policy_name = "pokemon_red_policy"
|
|
12
|
+
trace_format = "full"
|
|
13
|
+
return_trace = true
|
|
14
|
+
|
|
15
|
+
[eval.env_config]
|
|
16
|
+
max_steps_per_episode = 10
|
|
17
|
+
|
|
18
|
+
[eval.policy_config]
|
|
19
|
+
provider = "openai"
|
|
20
|
+
model = "gpt-4o-mini-2024-07-18"
|
|
21
|
+
inference_url = "https://api.openai.com"
|
|
22
|
+
temperature = 0.7
|
|
23
|
+
top_p = 0.95
|
|
24
|
+
max_tokens = 512
|
|
25
|
+
use_vision = true
|
|
26
|
+
image_only_mode = true
|
|
27
|
+
max_llm_calls = 10
|
|
28
|
+
|
|
29
|
+
|