
synth-ai/examples/finetuning/synth_qwen_v1/
in the repo synth-laboratories/synth-ai
.
Requirements
- Have
uv
installed and useuvx
/uv run
SYNTH_API_KEY
exported in your shell- Local tracing and environment service deployed with
uvx synth-ai serve
- End-to-end flow: generate v3 traces → filter to SFT JSONL → create/run SFT job → use the fine‑tuned adapter
- Uses
Qwen/Qwen3-0.6B
orQwen/Qwen3-4B-Instruct-2507
with tool-calling in Crafter - v1 scripts live under
examples/finetuning/synth_qwen_v1/
and call the backend directly
Overview: ReAct agent + tool-calling in Crafter (v1)
- Agent loop: A ReAct-style LLM agent runs inside the Crafter environment. Each turn the model thinks in text and issues a structured tool call (OpenAI functions) to act in the world.
- Tool-calling: We send OpenAI-compatible messages plus function tools (e.g., step/look). For Qwen3 we use its native chat template and support
tool_choice
andstop_after_tool_calls
to ensure a clean, single action per turn. - API usage (v1):
- Rollouts use Synth inference (OpenAI-compatible) to generate traces with Qwen.
- Traces are filtered to OpenAI-format SFT JSONL.
- SFT is kicked off via the backend; returns an id like
ft:Qwen/Qwen3-0.6B:ftjob-<uuid>
.
- Observability: Full tracing (SQLite/Turso) captures sessions, tool calls, rewards, and tokens for analysis and dataset creation.
- Generate traces (Qwen 0.6B by default)
- Filter traces → SFT JSONL (v1 helpers)
- Finetune (SFT)
- Evaluate the fine-tuned adapter