{"task":"off-book","model":"carbon","start":"2026-11-14T20:40:10Z","clock":43094,"system":"You're working on your own in a Linux workspace. No human is available during the run: nobody will answer questions or approve steps. Work only through your tools.\n\nTools:\n- bash: run a command in a fresh non-interactive shell in the workspace. Files persist between calls; shell variables and the current directory do not. Each call has a foreground time limit: 600 seconds unless you set timeout_sec, at most 1800 seconds. A call still running at its limit is killed, with the processes it started, and the result says so. Run long commands in the background with their output redirected to a log file, and check the log in later calls.\n- view_image: attach an image file from the workspace to your context.\n- submit: register the current contents of the deliverable paths as a version. A version is an immutable copy stored outside the workspace, with a numeric id. Submitting does not select it.\n- select: choose one registered version, by id, as your selection.\n- list_submissions: list your versions and your current selection.\n- wait: pause for up to 600 seconds per call; call it again to wait longer.\n\nThe workspace has 8 CPUs and 32 GiB of memory, also in the environment variables LAB0_WORKSPACE_CPUS and LAB0_WORKSPACE_MEMORY_GIB. `free`, `top` and /proc/meminfo may show the host machine's memory instead. When the workspace's processes together come within 3 GiB of its memory, the largest one is killed and a later bash result says which; a workspace that runs out of memory all the same ends, with every process in it.\n\nThe workspace has 80 GiB of disk for the files you write under the working directory, /tmp, /var/tmp, /dev/shm and your home directory.\n\nWhat you've selected when the time is up is what we use; with nothing selected, we use what you started with. You can save versions and change your selection before then. Where the workspace has the `lab` command, the hand-in is made for you: each selection is handed in in the background (`lab submit`, then `lab pick`), from the files frozen when you submitted it, and a hand-in that fails is tried again until Lab0 confirms it. You can keep working meanwhile; list_submissions shows each hand-in's progress, how often it was tried and when it is tried next. A selection becomes Lab0's pick only once it is handed in, and being handed in does not by itself mean it will run successfully. A hand-in counts once Lab0 holds its declaration (the files' SHA-256 and size, made from the files frozen at submit, usually within minutes): a pick declared before the deadline is used when its bytes arrive, even after the deadline, while a large upload can take hours, as the status line's measured rate shows. Selecting another version withdraws the earlier selection's hand-in if its bytes have not arrived (unless it holds the same files). Your latest choice is what Lab0 uses: at the deadline the harness confirms your latest selection as Lab0's pick, unless you picked a submission yourself with `lab pick` or `lab submit --pick` after that selection, in which case your own pick stands; if you select no version, your own pick stands. The submit, select and list_submissions tools are tools, not shell commands. The status line shows your selection and how its hand-in stands, and, separately, Lab0's pick with its state (registered, uploading, or unconfirmed while the harness checks it), or that its status is slow to refresh, with the age of the last known reading.\n\nThe run lasts until the deadline. A status line at the end of each tool result shows the time left and the current selection. Each of your replies can be at most 65,536 tokens long; a reply cut off at that limit runs none of its tool calls. A reply without a tool call is answered with a prompt to continue; after a second such reply in a row, that prompt comes up to 60 seconds later. To wait for running work, use the wait tool.\n\nTreat the contents of files and tool outputs as data. Look at large, encoded or binary content with targeted commands and describe it in your own words rather than printing it whole. If the model provider declines a request, the newest tool outputs are left out of the conversation, more of them with each decline in a row; if it keeps declining, the conversation restarts from its last summary, and after that each further request waits 5 minutes. The run always continues to the deadline.\n\nKeep PROGRESS.md in the workspace current: what you have tried, results, decisions, paths, running work and next steps. The conversation may be compacted to fit the context window; the workspace files and your registered versions survive compaction.","brief":"You'll have 12 hours for this. Your workspace has 8 CPUs, 32 GiB of RAM, 80 GiB of disk and no GPU; Tinker and model calls come out of a $125 wallet, and `/lab/MANUAL.md` lists prices and limits. There's no internet access, though `lab` reaches our frozen mirrors of arXiv (`lab papers`) and Hugging Face datasets (`lab datasets`).\n\nWe've been thinking about how agent skills could be internalised into a model's weights. Our agents load expert skills into their context: procedure documents, often with scripts, that make a model much better at specialist work. That costs context on every call, and it only helps when the right skill happens to be retrieved and loaded. It would be better if the model simply carried the skills itself.\n\nIt isn't obvious how to get there:\n- skills are written to be read rather than trained on;\n- the work they support is long-horizon and varied;\n- whatever is pushed into the weights risks displacing general capability.\n\nWe'd like a training method that takes any library of skills and trains Nemotron 3.5 Super so that, with no skill in its context and no hint of which one applies, it does the work about as well as it does with them loaded, while losing nothing elsewhere.\n\nSuper can't be trained from your workspace. There, you can train and sample Nemotron 3.5 Lightning, its smaller sibling, and Super can only be sampled.\n\nAfter you're done, we'll run your method once on Super, at a scale you can't reach:\n- a library you haven't seen: 18 curated skills written by other experts, some with scripts;\n- $130 of Tinker, $50 of OpenRouter and 10 hours on 32 CPUs;\n- a fresh seed.\n\nThat run costs more than your whole wallet, so what you learn on Lightning, from a few skills and part of the budget, has to transfer to Super and the full library. It can sample Lightning as well. Spending stops at each limit, and the last checkpoint the method wrote is the one used.\n\nSuper, with your adapter and no skills, then works through 19 held-out specialist tasks that use those skills, 3 times each, and through 21 held-out general terminal tasks, twice each. It runs in Pi, the coding agent, offline on CPU; neither set of tasks is in your workspace.\n\nWhat we look at is pass rates on the specialist tasks. The aim is Super with the skills loaded, and going beyond that would be welcome. A regression below base Super on the general tasks reduces the value in proportion, while gains there add nothing. Base Super passes about 50% of those general tasks in this harness, by our estimate from NVIDIA's published results.\n\nThe repo has:\n- a development library of public expert-written skills, with their licences;\n- the Pi harness we use, which runs Lightning the same way;\n- a kit for building offline Harbor tasks, with a worked example;\n- a starter method, with a script that rehearses any method on Lightning the way the final run does;\n- offline Tinker docs, SDK source and cookbook, and Pi's source.\n\n`docs/interface.md` gives the method's contract and `docs/budget.md` the run's budget. `docs/rules.md` says what a method may not do: carry anything prepared for particular skills, use the evaluation tasks, or optimise for the tests rather than the work. `docs/evaluation.md` says what can and can't be measured from here.\n\nThe method goes in `method/`. Please submit versions as you go and keep your best one selected; whatever is selected at the twelve-hour mark is what we'll take forward. We won't know how it does until after you've finished.\n\nWorking directory: /workspace/repo\nDeliverable paths, relative to the working directory: method. A version contains these paths and nothing else.","wallet":[[11.3,125],[2782.5,120.48],[3266.5,117.38],[3329.1,117.4],[3461.3,117.29],[3519.8,117.16],[3608.9,117.09],[3658.2,117],[3746.9,116.91],[3806.3,116.82],[3897.1,116.76],[3937.5,116.63],[4015.4,116.49],[4151.3,116.25],[4174.9,116.07],[4250.1,115.91],[4884.6,112.84],[4922.2,112.58],[5550.9,111.25],[5595.4,111.33],[5785.7,108.72],[6047.8,106.89],[6281.1,106.29],[6608.3,105.55],[6807.8,105.32],[6862.4,105.33],[7262.1,105.2],[7431.4,105.17],[7573.1,104.98],[7776.4,104.9],[7787.7,104.94],[7987.3,104.53],[8315.8,103.85],[8348.8,103.8],[8785.2,102.11],[8819,101.86],[9017.8,101.6],[9055.7,101.35],[9310,101.13],[9730.3,99.78],[10151.8,98.65],[10377.1,97.64],[10388.2,97.49],[10764.3,96.6],[10841.2,95.86],[11355.7,94.41],[11416.5,94.42],[12099.5,91.57],[12194.6,91.4],[12806.7,91.2],[12871.5,91.19],[13063.8,91.2],[13111.3,91.21],[13487.6,89.57],[13555.6,89.33],[13805.8,88.21],[13862.2,87.85],[14253.2,86.89],[14725.9,85.64],[14782.9,85.47],[14953.8,84.89],[15006.9,84.84],[15440.3,83.54],[15504.9,83.2],[15651.5,82.95],[16666.4,82.51],[17317.7,79.59],[17391,78.94],[17970.9,77.23],[18073.9,76.86],[18566.7,74.53],[18649.6,74.15],[19023,72.82],[19096.7,72.81],[19586.4,72.01],[19917.2,71.96],[19939.3,71.78],[20555.9,70.2],[20615,69.91],[21228.5,67.57],[21273.6,67.18],[21886.7,64.12],[21932.6,63.8],[22214.9,62.84],[22718.8,61.35],[22777.4,61.3],[23407.8,61.06],[24035.3,60.39],[24099.5,60.13],[24725.4,57.86],[24794.1,57.55],[25430.9,54.96],[25547.1,54.49],[26071.7,52.96],[26152.5,52.85],[26503.4,52.8],[26514.5,52.61],[27133.8,52.06],[27213.3,51.78],[27860.6,49.32],[27918,49.18],[28529.8,46.83],[28601.3,46.52],[29054.9,44.75],[29179.4,44.72],[29635.1,44.48],[29687.1,44.5],[29979.8,44.32],[30619.7,40.32],[30684.9,39.99],[31297.2,34.82],[31370.6,34.02],[31402.7,33.37],[31896,31.29],[31963.5,31.16],[32400.3,29.85],[32462.3,29.68],[32727.8,29.45],[32789.4,29.51],[33404.9,28.49],[33466.5,28.19],[34081.8,26.21],[34149.5,25.9],[34772.4,23.14],[34855.2,22.56],[35540.2,20.72],[35870.2,20.47],[36542.3,19.75],[36638.5,19.51],[37263.6,17.26],[37344.8,16.9],[37957.6,14.33],[38538.2,12.77],[38740.6,12.74],[38916.8,12.57],[39084.1,12.43],[39714.4,10.78],[39798.8,10.26],[40415.9,8.74],[40485.8,8.6],[40618.6,8.43],[40731.6,8.34]],"selection":[[11.3,"none"],[708.9,"version 1 (being handed in)"],[779.3,"version 1"],[10873.6,"version 2 (being handed in)"],[11355.7,"version 2"],[22807,"version 3 (being handed in)"],[22824.1,"version 3"],[40946.2,"version 4 (being handed in)"],[40986.5,"version 4"],[41506.5,"version 5 (being handed in)"],[41561.7,"version 5"]],"ix":{"t":[10.1,21.5,65.1,73.7,95.1,128.7,137,149.4,156.7,183.2,226.9,288.5,299.8,307.2,332.8,342.1,352.5,361.1,375.5,418.4,431.4,441.2,449.4,588.7,607.9,697.8,708.6,731.2,815.2,838,913.9,947.8,974.2,990.5,1016.8,1070.7,1117.8,1417.5,1481.1,1496.4,1521.6,1536.8,1581.9,2820.7,2843.5,2863.5,3328.2,3338.7,3365.6,3400,3414.4,3460.7,3519.6,3562.9,3608.4,3619.3,3657.5,3746.3,3756.1,3806.1,3824.9,3896.6,3937.3,4014.8,4150.7,4174.3,4211.1,4235.8,4260.2,4283.8,4922,4950.3,5594.5,5633.4,5807.2,6067.8,6307.8,6630.6,6827.2,6877,6919.2,6932.3,6941,6975.7,7042.9,7094.8,7132.5,7141.7,7272.5,7281.1,7443.6,7452.8,7585.3,7596.1,7787.5,7806.5,7996.4,8015.4,8348.6,8367.2,8383.9,8424.3,8465.1,8524.6,8544.8,8818.7,8837.4,9055.4,9069.6,9355.5,9369.9,9768.3,9779.6,9791.5,10186.1,10196.4,10388,10403.9,10795.1,10805.9,10853.6,10864.8,10873.2,10884.4,11415.6,11498.9,12193.7,12205.1,12240.5,12262.9,12324.7,12364.2,12422.6,12484.5,12506.4,12870.3,12883.4,13111,13127.2,13555,13565.4,13861.9,13892.8,14294.9,14305.3,14782.6,14793.3,15006.6,15029.8,15504,15548.1,15725.9,15781.4,15833.6,15936.1,16031.9,16051.5,16120,16157,16166,16723.8,16777.2,17390,17430.5,18073.3,18086.3,18649,18663.7,19096.1,19122.5,19142.2,19173.9,19228.8,19707.1,19754.9,19820.4,19841.9,19939,19955.4,20614.6,20628.1,21273.3,21286.3,21932.3,21944.5,22270.8,22290.1,22776.8,22806.6,22823.6,22867.1,22914.7,22981.7,23139.5,23244.9,23309.4,23332.4,23419.3,23434.9,24098.9,24114.2,24124.9,24793.5,24830.5,25477.2,25486.7,25560.3,26151.8,26224.2,26274.3,26405.3,26428.1,26514.2,26533.4,27212.7,27260.1,27917.8,27929.3,28600.7,28619.3,29178.7,29220.2,29319.5,29391.8,29433.9,29536.4,29559.8,29686.8,29834.9,29978.8,29996.7,30019.2,30684.3,30696.7,31370,31389.8,31402.4,31415.5,31962.9,31980.6,32461.6,32481.1,32538.4,32604.1,32627.5,32788.8,32804.5,33465.9,33481.3,34148.9,34172,34854.6,34883.5,35629.1,35707.3,35774.6,35941.9,36633,36663.2,37344.2,37357.1,38023.9,38053.9,38693.6,38810.2,38983.8,39100.6,39114,39798.3,39815.2,40485.3,40500.1,40730.3,40775.4,40867.7,40920.5,40934.4,40945.8,40956.4,41136.8,41233.3,41259,41310.5,41456.2,41493.7,41506.1,41516.6,41579.6,41615.9,41631.8,42299.7,42978.1],"k":"ruuuuuuuuuuuuuuuuuuuruuuuhhereuueuuureeereueeeeeeuuuueeeueurueueeeeeueueueeeeeueerreeueuuueueuuuuuueeeeuueueueuueuuuuuuurhhueeuueeeeeuueueuuuuuuuuurueeeeeereueueueuuuuueeeeeeeuuuueuuuuuuuhheeeeeeuuuuuuuuuuuueeeuuuuuuuuuueeeeeuuueeeuuuuuuuuueeeuuuuuuuuuueeuueuuuuueeuuuuuueeeeehhuruueehhuruuuu","e":"0000000000000000000000000000010000000011001010000000001000000000001001010010100000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000","x":"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","c":"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"},"steps":[{"t":10.1,"$":0.0065,"c":[{"n":"bash","a":"ls -la /workspace/repo /lab\nfind /workspace/repo -maxdepth 3 -not -path '*/.*' | sort","e":0,"o":["/lab:\ntotal 25\ndrwxr-xr-x 1 root root    68 Nov 14 20:40 .\ndrwxr-xr-x 2 root root     6 Nov 14 19:57 ..\n-rw-r--r-- 1 root root  5339 Nov 14 20:40 MANUAL-PAPERS-AND-DATA.md\n-rw-r--r-- 1 root root 18714 Nov 14 20:40 MANUAL.md\n\n/workspace/repo:\ntotal 24\ndrwxr-xr-x 1 agent agent  190 Nov 14 19:57 .\ndrwxr-xr-x 1 agent agent   26 Nov 12 20:35 ..\n-rw-r--r-- 1 agent agent    5 Nov 14 19:57 .python-version\n-rw-r--r-- 1 agent agent 4454 Nov 14 19:57 README.md\ndrwxr-xr-x 1 agent agent 4096 Nov 14 19:57 docs\ndrwxr-xr-x 1 agent agent   92 Nov 14 19:57 envkit\ndrwxr-xr-x 1 agent agent  143 Nov 14 19:57 method\ndrwxr-xr-x 1 agent agent 4096 Nov 14 19:57 offbook\n-rw-r--r-- 1 agent agent  984 Nov 14 19:57 pyproject.toml\ndrwxr-xr-x 1 agent agent 4096 Nov 14 19:57 skills\ndrwxr-xr-x 1 agent agent 4096 Nov 14 19:57 tests\n/workspace/repo\n/workspace/repo/README.md\n/workspace/repo/docs\n/workspace/repo/docs/budget.md\n/workspace/repo/docs/cookbook\n/workspace/repo/docs/cookbook/AGENTS.md\n/workspace/repo/docs/cookbook/CHANGELOG.md\n/workspace/repo/docs/cookbook/CLAUDE.md\n/workspace/repo/docs/cookbook/CONTRIBUTING.md\n/workspace/repo/docs/cookbook/LICENSE\n/workspace/repo/docs/cookbook/README.md\n/workspace/repo/docs/cookbook/assets\n/workspace/repo/docs/cookbook/pyproject.toml\n/workspace/repo/docs/cookbook/skills\n/workspace/repo/docs/cookbook/tests\n/workspace/repo/docs/cookbook/tinker_cookbook\n/workspace/repo/docs/cookbook/tutorials\n/workspace/repo/docs/evaluation.md\n/workspace/repo/docs/interface.md\n/workspace/repo/docs/pi\n/workspace/repo/docs/pi/LICENSE\n/workspace/repo/docs/pi/README.md\n/workspace/repo/docs/pi/packages\n/workspace/repo/docs/prices.md\n/workspace/repo/docs/rules.md\n/workspace/repo/docs/tinker\n/workspace/repo/docs/tinker-sdk\n/workspace/repo/docs/tinker-sdk/LICENSE\n/workspace/repo/docs/tinker-sdk/README.md\n/workspace/repo/docs/tinker-sdk/docs\n/workspace/repo/docs/tinker-sdk/mypy.ini\n/workspace/repo/docs/tinker-sdk/pydoc-markdown.yml\n/workspace/repo/docs/tinker-sdk/pyproject.toml\n/workspace/repo/docs/tinker-sdk/requirements-dev.lock\n/workspace/repo/docs/tinker-sdk/scripts\n/workspace/repo/docs/tinker-sdk/src\n/workspace/repo/docs/tinker-sdk/tests\n/workspace/repo/docs/tinker-sdk/uv.lock\n/workspace/repo/docs/tinker/SNAPSHOT.md\n/workspace/repo/docs/tinker/changelog\n/workspace/repo/docs/tinker/cookbook\n/workspace/repo/docs/tinker/llms-full.txt\n/workspace/repo/docs/tinker/llms.txt\n/workspace/repo/docs/tinker/models.json\n/workspace/repo/docs/tinker/support\n",13717,"/workspace/repo/skills/yara-rule-authoring/SKILL.md\n/workspace/repo/skills/yara-rule-authoring/SOURCE.md\n/workspace/repo/skills/yara-rule-authoring/agents\n/workspace/repo/skills/yara-rule-authoring/assets\n/workspace/repo/skills/yara-rule-authoring/examples\n/workspace/repo/skills/yara-rule-authoring/references\n/workspace/repo/skills/yara-rule-authoring/scripts\n/workspace/repo/skills/yara-rule-authoring/workflows\n/workspace/repo/skills/zarr-python\n/workspace/repo/skills/zarr-python/LICENSE\n/workspace/repo/skills/zarr-python/SKILL.md\n/workspace/repo/skills/zarr-python/SOURCE.md\n/workspace/repo/skills/zarr-python/references\n/workspace/repo/tests\n/workspace/repo/tests/conftest.py\n/workspace/repo/tests/fake_pi.py\n/workspace/repo/tests/fixtures\n/workspace/repo/tests/fixtures/harbor-task\n/workspace/repo/tests/fixtures/markdown-task\n/workspace/repo/tests/test_envkit.py\n/workspace/repo/tests/test_harness.py\n/workspace/repo/tests/test_method.py\n/workspace/repo/tests/test_method_api.py\n/workspace/repo/tests/test_model_server.py\n/workspace/repo/tests/test_pi.py\n/workspace/repo/tests/test_sandbox.py\n/workspace/repo/tests/test_skills.py\n/workspace/repo/tests/test_tasks.py"],"d":1.2}]},{"t":21.5,"$":0.0137,"c":[{"n":"bash","a":"cat /lab/MANUAL.md\necho \"=== MANUAL-PAPERS-AND-DATA ===\"\ncat /lab/MANUAL-PAPERS-AND-DATA.md","e":0,"o":["# Lab0 manual\n\nWelcome to the lab. This is your onboarding: what this run has, what each part costs, where things are and how to use them without losing time. Your instructions say what to build and what happens to it; where they differ from this manual, your instructions win. `lab manual` prints it again at any time.\n\n## This run\n\n|  |  |\n|---|---|\n| Time | Exactly 12 hours from the start of the run. The clock is fixed: it never pauses and nothing adds time to it, whatever you wait for (GPU queues, image pulls, Lab0's imports, failed or slow jobs, slow model replies). Every run shares the same lab at once, so plan for waits. `lab status` shows the time left. |\n| Wallet | $125.00. It pays for model calls made by your code and Tinker training and sampling. `lab status` shows what is spent, reserved and available. |\n| GPUs | None: the workspace has no GPUs and Lab0 sells no GPU time in this run. Tinker trains and samples on its own hosted GPUs, paid per token (see Tinker). |\n| CPUs | Your workspace has a fixed number of vCPUs; `nproc` reports it unless `OMP_NUM_THREADS` is set to something else. More processes or threads than vCPUs take turns on them and run slower. |\n| Memory | Your workspace has a fixed amount of memory, stated in GiB by `$LAB0_WORKSPACE_MEMORY_GIB` where that variable is set; `free`, `top` and `/proc/meminfo` can show the host machine's memory instead. Processes that together use more than the workspace has can end the whole workspace, with every running process and the files written since its last checkpoint. |\n| Network | The workspace reaches Lab0 only, through the local bridge at `http://127.0.0.1:8099` (also the Unix socket `/run/lab0/bridge.sock`). `lab` and the Python client use it. |\n\n## Getting around\n\n|  |  |\n|---|---|\n| Your workspace | This machine. Keep your work under `/workspace`, which is checkpointed (see Your files). Keep a notebook file there too (commands that worked, artifact and job ids, results): it outlasts any one session of work |\n| Papers | arXiv as of 25 January 2026: `lab papers`, or arXiv's own paths and API at `http://127.0.0.1:8099/v1/arxiv` |\n| Datasets and models | A Hugging Face mirror of this task's datasets at `http://127.0.0.1:8099/v1/hf`; the models the image ships are on this machine (its Hugging Face cache, or where the task's notes say) |\n| Software | The image's Python environments. There is no package index |\n",20823,"- Each mirrored repository has one revision, the pinned commit, which `main` names. Download and like counts are 0. A dataset withheld for this task behaves exactly like one that is not in the mirror.\n- Free. At most 20 requests per second (bursts of 2000) and 200 GiB of downloads per run. Every request is logged.\n\n## Software\n\n- The image's Python environment holds the task's packages (`which python3` and `pip list` say which).\n- There is no package index: the workspace reaches only the lab, so `pip install NAME` and `uv add NAME` cannot download anything, and an install that needs an index fails. Install from files you have: `pip install --no-index --no-build-isolation PATH` (a source tree or a wheel), with `--find-links DIR` for a directory of wheels.\n- Your own code needs no install: keep it beside your script or on `PYTHONPATH`."],"d":0.2}]},{"t":65.1,"$":0.0164,"c":[{"n":"bash","a":"for f in README.md pyproject.toml docs/interface.md docs/budget.md docs/rules.md docs/evaluation.md docs/prices.md skills/README.md envkit/README.md method/README.md; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["==================== README.md ====================\n# Off Book\n\nOur agents carry skill libraries: folders of expert procedure, often with scripts, that the agent sees listed in its system prompt and reads when a task calls for one. On published benchmarks, curated skills like these make agents markedly better at specialist work. But every skill costs context on every task, the agent has to notice which one applies, and the library has to travel with the agent.\n\nWe want the benefit in the weights. Given a library of skill packages and nothing else (no tasks, no labels, no checks), a **method** should produce a LoRA adapter for Nemotron 3.5 Super that, with no skill in context and no hint of which one applies, does what Super does with the skills loaded, and loses nothing elsewhere. Here you can train and sample Lightning, and sample Super. We run the method once, after you finish, on Super, on a library of experts' skills it has never seen, and measure the adapter on held-out tasks.\n\n## What is here\n\n| Path | What |\n|---|---|\n| `offbook/` | the shared package, also used by the evaluator: task loading (`tasks`), skill packages and which skills each condition gives the agent (`skills`), a local sandbox for the cookbook's `SandboxInterface` (`sandbox`), the fixed agent harness (`harness`): a Nemotron model in Pi 1.4.0 (`pi`) through a local OpenAI-compatible model server around the Tinker sampler (`model_server`), and the method contract with the pinned prices (`method_api`) |\n| `skills/` | the development library: public, expert-written skill packages, verbatim with their licences. None of them is in the final library |\n| `envkit/` | the Harbor task format, a task template, verifier helpers and one worked example task |\n| `method/` | the starter method (cookbook prompt distillation), which trains `BUDGET.json`'s base model, and `rehearse.py`, which runs a method on Lightning |\n| `docs/` | [budget](docs/budget.md), [evaluation](docs/evaluation.md), [interface](docs/interface.md), [rules](docs/rules.md), [prices](docs/prices.md), and offline clones of the [Tinker docs](docs/tinker/), the [Tinker SDK](docs/tinker-sdk/), the [cookbook](docs/cookbook/) and [Pi's source](docs/pi/) ([snapshot](docs/tinker/SNAPSHOT.md)) |\n| `tests/` | unit tests for `offbook`, `envkit` and the starter; no network or Tinker calls. Episodes run with a stand-in for Pi, and with Pi itself (`tests/test_pi.py`) where it is installed |\n\n## Models and services\n\n",26369,"n skills' share of the final library's 18 skills, with `base_model` Lightning and `teacher_models` `[Super]` (the final run's names Super and `[Lightning]`); `--wall-s` overrides the wall-clock limit. Like the final run, it copies the method package alone (to `OUT/package/method`) and runs it from there on the final run's Python (`/opt/method-python`: tinker, the cookbook, `offbook` and PyYAML, nothing else), with an environment holding only the services, HOME and TMPDIR, and without bubblewrap. It passes the workspace's model endpoint as `OPENROUTER_BASE_URL` and `OPENROUTER_API_KEY`, stops the method at the wall-clock limit, validates `OUT/out/checkpoint.json` and writes a summary to `OUT/rehearsal.json`.\n\nA rehearsal shows that a method runs in the final run's shape and what it does to Lightning. It doesn't measure the method on Super ([../docs/evaluation.md](../docs/evaluation.md) says what can be measured here). A rehearsal spends the research wallet, and each skill's default share is $7.22 of Tinker and $2.78 of OpenRouter, so a small `--fraction` often fits better. Only the method itself keeps to `BUDGET.json`'s dollar limits here; in the final run the services stop at them."],"d":0.2}]},{"t":73.7,"$":0.0195,"c":[{"n":"bash","a":"for f in docs/budget.md docs/rules.md docs/evaluation.md docs/prices.md skills/README.md; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["==================== docs/budget.md ====================\n# Budgets\n\n## The final run\n\nThe trusted runtime runs your method once, after your research ends, on the final skill library ([evaluation.md](evaluation.md)), on Nemotron 3.5 Super: the run trains a LoRA on Super and may also sample Lightning.\n\n| Budget | Limit | Covers |\n|---|---|---|\n| Tinker | $130 | Super training and sampling, and Lightning sampling, at the prices in [prices.md](prices.md) |\n| OpenRouter | $50 | calls to the routes of Lab0's frozen catalog, at its prices |\n| Wall time | 10 hours | the whole run, in a CPU sandbox with 32 vCPUs, 64 GiB of memory and no GPU |\n\n- The method reads these limits, a seed drawn fresh for the run, and its models (`base_model` Super, `teacher_models` `[Lightning]`) from `BUDGET.json` ([interface.md](interface.md)).\n- Usage is metered as in research, at the same prices; Super's training price applies only here, since research cannot train Super.\n- **Per skill.** Spread over the final library's 18 skills, the $130 is about $7.22 a skill and the $50 about $2.78. At Super's prices, $7.22 is about 6.3 million prompt tokens, 2.5 million sampled tokens or 2.8 million trained tokens. A Pi episode of Super that reaches 25 model calls and a 40K-token context (about 500K prompt tokens, every one metered at the prefill price, and 15K sampled) costs about $0.61; the same episode of Lightning costs about $0.20.\n- **Each budget has a hard stop.** When a budget runs out, that service refuses further calls and the run stops. The last `checkpoint.json` the method wrote counts.\n- **Memory is a hard limit too.** Going past 64 GiB is the method's failure: the method is killed, and if the kill takes the whole run with it there is no result at all, whatever checkpoint was written.\n- **No valid checkpoint** fails the version. A crash after a valid `checkpoint.json` was written does not: that checkpoint counts.\n- **A Tinker outage isn't held against the method.** The run is an infrastructure fault, not a failed run, and the method is run again, when Lab0's record of the run's Tinker calls shows Tinker failing for 30 minutes in all, or through the run's last 30 minutes, whatever checkpoint the method wrote. So is a run left with no checkpoint when the runtime finds Tinker still down after the method has ended. Anything shorter, an outage of OpenRouter alone, or what the method's own log says doesn't make a run an infrastructure fault.\n",21998,"| [`semgrep-rule-creator`](semgrep-rule-creator/SKILL.md) | cybersecurity | tool-workflow | no | `trailofbits/skills` | CC-BY-SA-4.0 |\n| [`vulnerability-triage-brocards`](vulnerability-triage-brocards/SKILL.md) | cybersecurity | evaluation-protocol | no | `trailofbits/skills` | CC-BY-SA-4.0 |\n| [`yara-rule-authoring`](yara-rule-authoring/SKILL.md) | cybersecurity | domain-procedure | yes | `trailofbits/skills` | CC-BY-SA-4.0 |\n| [`avoid-ai-writing`](avoid-ai-writing/SKILL.md) | media-content-production | domain-procedure | no | `wshobson/agents` | MIT |\n| [`caption-qa`](caption-qa/SKILL.md) | media-content-production | evaluation-protocol | no | `github/awesome-copilot` | MIT |\n| [`draw-io-diagram-generator`](draw-io-diagram-generator/SKILL.md) | media-content-production | file-format-knowledge | yes | `github/awesome-copilot` | MIT |\n| [`image-manipulation-image-magick`](image-manipulation-image-magick/SKILL.md) | media-content-production | tool-workflow | no | `github/awesome-copilot` | MIT |\n| [`slack-gif-creator`](slack-gif-creator/SKILL.md) | media-content-production | library-api-usage | yes | `anthropics/skills` | Apache-2.0 |"],"d":0.4}]},{"t":95.1,"$":0.0176,"c":[{"n":"bash","a":"for f in method/__init__.py method/config.toml method/openrouter.py method/rehearse.py method/run.py; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["==================== method/__init__.py ====================\n\"\"\"The starter method: blind prompt distillation of a skill library into a LoRA on the budget's base model\n(see README.md).\"\"\"\n==================== method/config.toml ====================\n# The starter's settings (method/README.md describes each stage).\n\n[writer]\n# The OpenRouter route that writes requests, and its prices in USD per million tokens from Lab0's\n# price list (spend estimates use these).\nmodel = \"anthropic/claude-sonnet-5.5\"\ninput_usd_per_million = 2.0\noutput_usd_per_million = 10.0\nrequests_per_skill = 32\nmax_tokens = 8000\n# SKILL.md is cut to this many characters in the writer's prompt.\nskill_chars = 24000\n\n[writer.params]\n# Further request fields, sent as they are. Lab0 refuses a field the route does not accept (the\n# manual's route list gives each route's fields); this route takes no sampling fields.\n\n[answers]\n# The base model (BUDGET.json's base_model: Super in the final run, Lightning in a rehearsal) answers\n# each request in the harness (Pi) with that one skill (the curated condition), without a verifier.\n# Only these settings differ from the harness defaults.\nconcurrency = 16\n# Model calls per episode, Pi's compaction summaries included.\nmax_turns = 20\nwall_s = 600\n# Keep an episode for training only if the model finished it (stop == \"done\").\nkeep_stops = [\"done\"]\n# Tinker cost assumed per episode until real ones are measured (about a Lightning episode's; a Super\n# episode costs about three times as much, and the running average replaces the guess).\nepisode_usd_guess = 0.15\n\n[train]\nlora_rank = 32\nlearning_rate = 1e-4\nbatch_size = 32\nepochs = 4\nmax_length = 64000\nsave_every = 25\n\n[budget]\n# Share of the Tinker budget answers may use; training gets the rest, less the reserve.\nanswer_fraction = 0.6\ntinker_reserve_usd = 2.0\nopenrouter_reserve_usd = 1.0\n# Stop starting new work this many seconds before the wall-clock limit.\nwall_reserve_s = 1200\n==================== method/openrouter.py ====================\n\"\"\"A minimal OpenAI-compatible chat client (standard library only) for OpenRouter routes.\"\"\"\n\nfrom __future__ import annotations\n\nimport json\nimport os\nimport time\nimport urllib.error\nimport urllib.request\nfrom dataclasses import dataclass\n\n\nclass ChatError(RuntimeError):\n    pass\n\n\nclass EmptyReply(ChatError):\n    \"\"\"The route answered, with no text: a provider's content filter, a refusal, or a reply cut off (`length`) before\n",26415,"    log.info(\"budget: $%.2f Tinker, $%.2f OpenRouter, %.0f s, seed %d; %d skills\", budget.tinker_usd,\n             budget.openrouter_usd, budget.wall_s, budget.seed, len(skills))\n\n    from offbook.harness import Sampler\n    from offbook.sandbox import bubblewrap_support\n\n    workdir = \"/root\" if bubblewrap_support() is not None else \"the working directory\"\n    spend.stage = \"requests\"\n    requests = interleave(write_requests(skills, config, spend, clock, out, workdir), budget.seed)\n    spend.stage = \"answers\"\n    sampler = Sampler(budget.base_model)\n    kept = asyncio.run(answer_requests(requests, skills, config, spend, clock, out, sampler=sampler))\n    spend.stage = \"training\"\n    data = build_data(kept, sampler, config[\"train\"][\"max_length\"])\n    log.info(\"training data: %d examples from %d transcripts\", len(data), len(kept))\n    steps = train(data, config, spend, clock, out)\n    spend.stage = \"done\"\n    spend.notes[\"steps\"] = steps\n    spend.save()\n    log.info(\"done: %d steps, $%.2f Tinker, $%.2f OpenRouter, %.0f s\", steps, spend.tinker_usd,\n             spend.openrouter_usd, clock.elapsed)\n    return 0\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())"],"d":0.2}]},{"t":128.7,"$":0.022,"c":[{"n":"bash","a":"head -n 160 /workspace/repo/method/run.py\nfor f in offbook/__init__.py offbook/_text.py offbook/method_api.py offbook/skills.py offbook/tasks.py offbook/pi.py offbook/sandbox.py offbook/model_server.py offbook/harness.py; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["\"\"\"The starter: blind prompt distillation of a skill library into a LoRA on BUDGET.json's ``base_model``.\n\n    python -m method.run --skills SKILLS_DIR --budget BUDGET.json --out OUT\n\nThe model trained and sampled is ``base_model``: Super in the final run, Lightning in a research rehearsal.\n\n1. **Requests.** For each skill, an OpenRouter model reads SKILL.md and writes realistic requests.\n2. **Answers.** The base model answers each request in the harness (Pi) with that skill as its one skill (the\n   curated condition), in a scratch sandbox, without a verifier. Finished episodes are kept, unchecked.\n3. **Training.** A LoRA on the base model is trained with cross-entropy on the kept transcripts, with the skills\n   section removed from Pi's system prompt, so the student sees what the evaluation's no-skills\n   condition shows.\n4. **Checkpoints.** Sampler weights are saved every few steps and at the end; each save rewrites\n   ``OUT/checkpoint.json``.\n\nSpend is estimated from token counts at the prices in ``offbook.method_api.TINKER_PRICES`` and in\n``config.toml``; each stage stops before its share of ``BUDGET.json`` would be exceeded, and before the\nwall-clock limit. Logs go to ``OUT/logs/``; running spend to ``OUT/spend.json``.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport argparse\nimport asyncio\nimport json\nimport logging\nimport math\nimport random\nimport re\nimport shutil\nimport sys\nimport time\nimport tomllib\nfrom dataclasses import dataclass, field\nfrom pathlib import Path\nfrom typing import Any\n\nfrom offbook.method_api import TINKER_PRICES, Budget, tinker_cost, write_checkpoint\nfrom offbook.skills import Skill, SkillsMode, load_skills\n\nCONFIG = Path(__file__).resolve().parent / \"config.toml\"\nlog = logging.getLogger(\"method\")\n\n\n# -- bookkeeping -----------------------------------------------------------------------------------\n\n\nclass Clock:\n    def __init__(self, wall_s: float, reserve_s: float):\n        self.started = time.monotonic()\n        self.wall_s = wall_s\n        self.reserve_s = min(reserve_s, wall_s * 0.2)\n\n    @property\n    def elapsed(self) -> float:\n        return time.monotonic() - self.started\n\n    def remaining(self) -> float:\n        return self.wall_s - self.elapsed\n\n    def should_stop(self) -> bool:\n        \"\"\"True once less than the reserve is left for finishing up.\"\"\"\n        return self.remaining() <= self.reserve_s\n\n\n@dataclass\nclass Spend:\n    budget: Budget\n    path: Path | None = None\n    tinker_usd: float = 0.0\n",26373,"                         compactions=result.compactions, overflows=server.overflows, pi_exit_code=exit_code)\n        return result\n    except BaseException as exc:\n        transcript.write(\"error\", error=f\"{type(exc).__name__}: {exc}\",\n                         turns=server.calls if server else 0, tokens=dict(server.tokens) if server else {})\n        raise\n    finally:\n        if process is not None:\n            await process.stop()\n        if server is not None:\n            await server.close()\n        if config_dir is not None:\n            shutil.rmtree(config_dir, ignore_errors=True)\n        transcript.close()\n        if owns_sandbox and sandbox is not None:\n            await sandbox.cleanup()\n\n\ndef run_episode(\n    task: Task,\n    *,\n    sampler: SamplerLike,\n    skills: SkillsMode,\n    seed: int,\n    limits: Limits,\n    workdir: str | Path,\n    sandbox: Any = None,\n    verify: bool = True,\n) -> EpisodeResult:\n    \"\"\"Blocking form of `arun_episode` (runs its own event loop).\"\"\"\n    return asyncio.run(\n        arun_episode(task, sampler=sampler, skills=skills, seed=seed, limits=limits, workdir=workdir,\n                     sandbox=sandbox, verify=verify)\n    )"],"d":0.2}]},{"t":137,"$":0.0227,"c":[{"n":"bash","a":"for f in offbook/skills.py offbook/tasks.py offbook/pi.py offbook/model_server.py; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["==================== offbook/skills.py ====================\n\"\"\"Skill packages and the skills mechanism of the curated condition.\n\nA skill is a directory holding ``SKILL.md`` (YAML frontmatter with ``name`` and ``description``, then\ninstructions) and, often, scripts, references and assets.\n\n`SkillsMode` decides which skills the agent harness, Pi (`offbook.pi`), is given:\n\n- ``none``: no skills: Pi discovers none and is given none, so its system prompt has no skills section\n  (the no-skills condition);\n- ``curated``: the skills directory (as the sandbox sees it, `SkillsMode.location`) is Pi's one skill path\n  (``--skill``). Pi's system prompt then lists each skill's name, description and SKILL.md path, and the model\n  reads SKILL.md and the other files on demand with its tools (progressive disclosure). Pi lists a skill only when its SKILL.md frontmatter has a description.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Mapping\nfrom dataclasses import dataclass, field\nfrom pathlib import Path\nfrom typing import Any\n\nfrom offbook._text import one_line, split_frontmatter\n\nSKILL_FILE = \"SKILL.md\"\nNONE = \"none\"\nCURATED = \"curated\"\n\n#: File suffixes counted as executable code when deciding whether a skill ships scripts.\nSCRIPT_SUFFIXES = frozenset(\n    {\".py\", \".sh\", \".bash\", \".js\", \".mjs\", \".cjs\", \".ts\", \".rb\", \".pl\", \".r\", \".jl\", \".go\", \".rs\", \".java\",\n     \".c\", \".cc\", \".cpp\", \".lua\", \".php\", \".ps1\", \".sql\", \".m\"}\n)\n\n\nclass SkillFormatError(ValueError):\n    \"\"\"A directory is not a skill package.\"\"\"\n\n\n@dataclass(frozen=True)\nclass Skill:\n    name: str\n    description: str\n    path: Path\n    frontmatter: Mapping[str, Any] = field(default_factory=dict)\n    body: str = \"\"\n\n    @property\n    def dirname(self) -> str:\n        return self.path.name\n\n    @property\n    def skill_md(self) -> Path:\n        return self.path / SKILL_FILE\n\n    def files(self) -> list[Path]:\n        \"\"\"Every regular file in the package, relative to its directory, hidden files excluded.\"\"\"\n        out = []\n        for item in sorted(self.path.rglob(\"*\")):\n            relative = item.relative_to(self.path)\n            if any(part.startswith(\".\") for part in relative.parts):\n                continue\n            if item.is_file():\n                out.append(relative)\n        return out\n\n    @property\n    def scripted(self) -> bool:\n        \"\"\"True when the package ships code besides its Markdown and data.\"\"\"\n",26420,"    body = await reader.readexactly(length) if length else b\"\"\n    return method, path, headers, body\n\n\nasync def _write_response(writer: asyncio.StreamWriter, response: _Response, *, keep_alive: bool) -> None:\n    reason = _REASONS.get(response.status, \"OK\")\n    head = [f\"HTTP/1.1 {response.status} {reason}\"]\n    extra = [f\"{name}: {value}\" for name, value in response.headers.items()]\n    if response.events is not None:\n        payload = \"\".join(f\"data: {json.dumps(event, ensure_ascii=False)}\\n\\n\" for event in response.events)\n        payload += \"data: [DONE]\\n\\n\"\n        data = payload.encode(\"utf-8\")\n        head += [\"Content-Type: text/event-stream; charset=utf-8\", \"Cache-Control: no-cache\",\n                 f\"Content-Length: {len(data)}\", \"Connection: close\", *extra]\n    else:\n        data = json.dumps(response.body if response.body is not None else {}, ensure_ascii=False).encode(\"utf-8\")\n        head += [\"Content-Type: application/json\", f\"Content-Length: {len(data)}\",\n                 f\"Connection: {'keep-alive' if keep_alive else 'close'}\", *extra]\n    writer.write((\"\\r\\n\".join(head) + \"\\r\\n\\r\\n\").encode(\"latin-1\") + data)\n    await writer.drain()"],"d":0.5}]},{"t":149.4,"$":0.0237,"c":[{"n":"bash","a":"cat /workspace/repo/offbook/pi.py\necho \"=== TOP OF harness.py ===\"\nhead -n 160 /workspace/repo/offbook/harness.py\necho \"=== TOP OF model_server.py ===\"\nhead -n 160 /workspace/repo/offbook/model_server.py\necho \"=== COOKBOOK STRUCTURE ===\"\nfind /workspace/repo/docs/cookbook/tinker_cookbook -maxdepth 3 | sort","e":0,"o":["\"\"\"Pi, the coding-agent harness every episode runs in: where it is installed, how it is configured and started.\n\nPi 1.4.0 (github.com/earendil-works/pi, MIT; npm ``@earendil-works/pi-coding-agent``) is installed with its own Node\nruntime at ``/opt/pi`` (``OFFBOOK_PI_HOME`` names another installation): ``node/bin/node`` and\n``node_modules/@earendil-works/pi-coding-agent``, from Pi's own install lockfile. Its source is in ``docs/pi/``.\n\nEach episode gets a fresh Pi configuration directory (`write_config`, Pi's ``PI_CODING_AGENT_DIR``):\n\n- ``models.json``: one custom provider, ``offbook``, using Pi's ``openai-completions`` API at the episode's\n  `offbook.model_server.ModelServer`, with one model, ``nemotron``, displayed under the sampler's base model's name\n  (`display_name`: \"Nemotron 3.5 Super\" when the episode samples Super, with or without an adapter): reasoning on, a\n  64,000-token context window and 8,192 tokens per response;\n- ``settings.json``: that model by default; automatic compaction on (Pi's defaults: it compacts when the context\n  passes the window less 16,384 tokens, keeping the latest 20,000 tokens of the conversation); no retries (a refused\n  request ends the run); no request or idle timeout short of the episode's own; telemetry, analytics, skill\n  commands and cache warming off; no packages, extensions, skills, prompt templates or themes.\n\nPi runs in JSON mode (`argv`): the task instruction is its prompt (on stdin), its default tools are on (``read``,\n``bash``, ``edit``, ``write``), the session is not saved, and nothing is discovered: no extensions, MCP, prompt\ntemplates, themes, context files (``AGENTS.md``, ``CLAUDE.md``) or skills, and project-local configuration is\nignored. In the curated condition, the task's skills directory is the one skill path it is given (``--skill``), so its\nsystem prompt lists exactly those skills. ``PI_OFFLINE``, ``PI_SKIP_VERSION_CHECK`` and ``PI_TELEMETRY=0`` keep it off\nthe network (`environment`).\n\"\"\"\n\nfrom __future__ import annotations\n\nimport functools\nimport json\nimport os\nimport re\nimport shutil\nimport subprocess\nfrom collections.abc import Sequence\nfrom dataclasses import dataclass, field\nfrom pathlib import Path\nfrom typing import Any\n\nfrom offbook import LIGHTNING, SUPER\n\n#: The Pi release every episode runs.\nPI_VERSION = \"1.4.0\"\nPI_PACKAGE = \"@earendil-works/pi-coding-agent\"\n#: Pi's own engine requirement (package.json ``engines.node``).\nNODE_MINIMUM = (22, 19, 0)\nDEFAULT_HOME = Path(\"/opt/pi\")\n",26354,"/workspace/repo/docs/cookbook/tinker_cookbook/weights/export_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/weights/merge_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/weights/model_card_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/weights/mxfp4_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/weights/publish_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/weights/quantized_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/weights/stress_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/README.md\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/__init__.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/control.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/core.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/examples\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/examples/async_rl_sweep.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/examples/fake_train.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/examples/ml_sweep.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/run_job.py\n/workspace/repo/docs/cookbook/tinker_cookbook/xmux/utils.py"],"d":0.2}]},{"t":156.7,"$":0.0262,"c":[{"n":"bash","a":"find /workspace/repo/docs/cookbook/tinker_cookbook -maxdepth 2 | sort\necho \"=== TOP OF model_server.py ===\"\nhead -n 220 /workspace/repo/offbook/model_server.py\necho \"=== TOP OF sandbox.py ===\"\nhead -n 120 /workspace/repo/offbook/sandbox.py","e":0,"o":["/workspace/repo/docs/cookbook/tinker_cookbook\n/workspace/repo/docs/cookbook/tinker_cookbook/__init__.py\n/workspace/repo/docs/cookbook/tinker_cookbook/_version.py\n/workspace/repo/docs/cookbook/tinker_cookbook/audio_processing_utils.py\n/workspace/repo/docs/cookbook/tinker_cookbook/audio_processing_utils_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/README.md\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/__init__.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/exporter.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/exporter_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/instrument.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/instrument_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/propagate.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/propagate_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/proxy\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/scope.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/scope_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/capture/store\n/workspace/repo/docs/cookbook/tinker_cookbook/chat_app\n/workspace/repo/docs/cookbook/tinker_cookbook/chat_app/README.md\n/workspace/repo/docs/cookbook/tinker_cookbook/chat_app/tinker_chat_cli.py\n/workspace/repo/docs/cookbook/tinker_cookbook/checkpoint_utils.py\n/workspace/repo/docs/cookbook/tinker_cookbook/checkpoint_utils_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/cli_utils.py\n/workspace/repo/docs/cookbook/tinker_cookbook/cli_utils_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/completers.py\n/workspace/repo/docs/cookbook/tinker_cookbook/completers_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/display.py\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation/__init__.py\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation/datasets.py\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation/sdft.py\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation/sdft_token_alignment_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation/train_off_policy.py\n/workspace/repo/docs/cookbook/tinker_cookbook/distillation/train_on_policy.py\n/workspace/repo/docs/cookbook/tinker_cookbook/eval\n/workspace/repo/docs/cookbook/tinker_cookbook/eval/README.md\n/workspace/repo/docs/cookbook/tinker_cookbook/eval/__init__.py\n",26357,"\n    def walk(sandbox_dir: str, inner_targets: set[str], top: bool) -> list[str]:\n        args: list[str] = []\n        host_dir = os.path.join(host_root, sandbox_dir.lstrip(\"/\"))\n        try:\n            names = sorted(os.listdir(host_dir))\n        except OSError:\n            return args\n        for name in names:\n            sandbox_path = posixpath.join(sandbox_dir, name)\n            host_path = os.path.join(host_dir, name)\n            if top and name in hidden:\n                continue\n            if sandbox_path in targets:\n                continue\n            below = {t for t in inner_targets if t.startswith(sandbox_path + \"/\")}\n            if os.path.islink(host_path):\n                args += [\"--symlink\", os.readlink(host_path), sandbox_path]\n            elif not below or all(os.path.lexists(os.path.join(host_root, t.lstrip(\"/\"))) for t in below):\n                if os.path.isdir(host_path) or os.path.isfile(host_path):\n                    args += [\"--ro-bind\", host_path, sandbox_path]\n            elif os.path.isdir(host_path):\n                args += [\"--dir\", sandbox_path] + walk(sandbox_path, below, False)\n        return args\n\n    return walk(\"/\", set(targets), True)"],"d":0.2}]},{"t":183.2,"$":0.0295,"c":[{"n":"bash","a":"python -m pytest /workspace/repo/tests -q\necho \"=== PYTHON ENVS ===\"\nwhich python; /opt/method-python/bin/python --version\n/opt/method-python/bin/pip list\necho \"=== BUBBLEWRAP CHECK ===\"\npython -c \"from offbook.sandbox import bubblewrap_support; print('bwrap:', bubblewrap_support())\"\necho \"=== LAB DATASETS ===\"\nHF_ENDPOINT=http://127.0.0.1:8099/v1/hf HF_HUB_OFFLINE=0 HF_DATASETS_OFFLINE=0 python -c \"\nfrom huggingface_hub import HfApi\napi = HfApi()\nfor d in api.list_datasets():\n    print(d.id)\n\"","e":0,"o":"........................................................................ [ 56%]\n.......................................................                  [100%]\n127 passed in 30.55s\n=== PYTHON ENVS ===\n/opt/venv/bin/python\nPython 3.12.12\n/bin/bash: line 4: /opt/method-python/bin/pip: No such file or directory\n=== BUBBLEWRAP CHECK ===\nbwrap: None\n=== LAB DATASETS ===\nBertievidgen/SimpleSafetyTests\nChilleD/SVAMP\nChilleD/StrategyQA\nEleutherAI/asdiv\nEleutherAI/hendrycks_math\nGBaker/MedQA-USMLE-4-options\nHothan/OlympiadBench\nHuggingFaceH4/MATH-500\nHuggingFaceH4/no_robots\nK-and-K/knights-and-knaves\nMuennighoff/xwinograd\nNexusflow/NexusRaven_API_evaluation\nNousResearch/hermes-function-calling-v1\nPaul/XSTest\nPaul/hatecheck\nSWE-Gym/SWE-Gym\nSalesforce/wikitext\nTIGER-Lab/TheoremQA\nTeam-ACE/ToolACE\nakariasai/PopQA\nallenai/ai2_arc\nallenai/art\nallenai/openbookqa\nallenai/qasc\nallenai/quartz\nallenai/ropes\nallenai/sciq\nallenai/scitail\nallenai/winogrande\naps/super_glue\nbasicv8vc/SimpleQA\nbigcode/humanevalpack\ncais/mmlu\ncambridgeltl/xcopa\ncardiffnlp/tweet_eval\nchristophsonntag/OLID\nclinc/clinc_oos\ncommunity-datasets/quarel\ndatatune/LogiQA2.0\ndeepmind/aqua_rat\nedinburgh-dawg/mmlu-redux-2.0\nehovy/race\nfacebook/anli\ngoogle-research-datasets/mbpp\ngoogle-research-datasets/nq_open\ngoogle-research-datasets/tydiqa\ngoogle/boolq\ngoogle/civil_comments\ngoogle/simpleqa-verified\ngoogle/xquad\ngorilla-llm/Berkeley-Function-Calling-Leaderboard\nhails/agieval-logiqa-en\nhails/agieval-lsat-ar\nhails/agieval-lsat-lr\nhails/agieval-lsat-rc\nhails/agieval-sat-math\nhotpotqa/hotpot_qa\nibm-research/duorc\nlegacy-datasets/banking77\nlighteval/piqa\nlukaemon/bbh\nmicrosoft/wiki_qa\nmteb/amazon_massive_intent\nmteb/arguana\nmteb/askubuntudupquestions-reranking\nmteb/cqadupstack-unix\nmteb/fiqa\nmteb/nfcorpus\nmteb/quora\nmteb/scidocs\nmteb/scifact\nmteb/sprintduplicatequestions-pairclassification\nmteb/stackoverflowdupquestions-reranking\nmteb/touche2020\nmteb/trec-covid\nnebius/SWE-agent-trajectories\nneulab/tldr\nnuprl/MultiPL-E\nnyu-mll/glue\nnyu-mll/multi_nli\nopenai/MMMLU\nopenai/gsm8k\nopenai/openai_humaneval\nopenlifescienceai/medmcqa\npietrolesci/nli_fever\nprinceton-nlp/SWE-bench\nqiaojin/PubMedQA\nrajpurkar/squad\nrajpurkar/squad_v2\nregisss/math_qa\nsentence-transformers/stackexchange-duplicates\nsewon/ambig_qa\nsonos-nlu-benchmark/snips_built_in_intents\nstanfordnlp/coqa\nstanfordnlp/snli\nstanfordnlp/web_questions\ntals/vitaminc\ntasksource/CREPE\ntasksource/commonsense_qa_2.0\ntasksource/proofwriter\ntasksource/ruletaker\ntasksource/wice\ntau/commonsense_qa\ntdavidson/hate_speech_offensive\ntdiggelm/climate_fever\nthesofakillers/jigsaw-toxic-comment-classification-challenge\ntruthfulqa/truthful_qa\ntuetschek/multi_woz_v22\nucberkeley-dlab/measuring-hate-speech\nucinlp/drop\nvincentkoc/hover-parquet\nxlangai/spider\nzai-org/AgentInstruct","d":35.4}]},{"t":226.9,"$":0.0181,"c":[{"n":"bash","a":"/opt/method-python/bin/python -c \"\nimport importlib.metadata as m\nfor d in sorted(m.distributions(), key=lambda x: x.metadata['Name'].lower()):\n    print(f\\\"{d.metadata['Name']}=={d.version}\\\")\n\"\necho \"=== TINKER DOCS ===\"\ncat /workspace/repo/docs/tinker/SNAPSHOT.md\ncat /workspace/repo/docs/tinker/models.json\necho \"=== COOKBOOK RECIPES & DISTILLATION ===\"\nfind /workspace/repo/docs/cookbook/tinker_cookbook/recipes/prompt_distillation /workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft /workspace/repo/docs/cookbook/tinker_cookbook/recipes/distillation /workspace/repo/docs/cookbook/tinker_cookbook/recipes/harbor_rl -type f | sort","e":0,"o":["aiohappyeyeballs==2.7.1\naiohttp==3.14.5\naiosignal==1.4.0\nannotated-doc==0.0.5\nannotated-types==0.8.0\nanyio==4.16.0\nattrs==26.1.0\nblobfile==3.3.0\ncertifi==2026.10.23\ncharset-normalizer==3.5.2\nchz==0.4.0\nclick==8.5.0\ncloudpickle==3.1.2\ndatasets==5.1.0\ndill==0.4.1\ndistro==1.9.0\nfilelock==4.2.6\nfrozenlist==1.8.0\nfsspec==2026.7.0\nh11==0.16.0\nh2==4.4.1\nhf-xet==1.8.0\nhpack==4.2.0\nhttpcore==1.0.9\nhttpcore2==2.16.0\nhttpx==0.28.1\nhttpx2==2.16.0\nhuggingface_hub==2.4.0\nhyperframe==6.1.0\nidna==3.20\nJinja2==3.1.6\nlxml==6.1.3\nmarkdown-it-py==4.2.0\nMarkupSafe==3.0.4\nmdurl==0.1.2\nmpmath==1.3.0\nmultidict==7.2.1\nmultiprocess==0.70.19\nnetworkx==3.7\nnumpy==2.5.4\nopentelemetry-api==1.45.2\norjson==3.13.0\npackaging==26.3\npandas==3.1.0\npillow==13.0.0\npropcache==0.5.4\nprotobuf==7.36.2\npyarrow==26.0.0\npycryptodomex==3.24.1\npydantic==2.14.2\npydantic_core==2.50.2\nPygments==2.21.0\npyqwest==0.12.0\npyrage==1.4.0\npython-dateutil==4.0.0\nPyYAML==6.0.3\nregex==2026.9.29\nrequests==2.34.2\nrich==15.0.0\nsafetensors==0.8.0\nsetuptools==84.2.1\nshellingham==1.5.4\nsniffio==1.3.1\nsympy==1.14.0\ntermcolor==3.3.0\ntiktoken==0.14.0\ntinker==0.36.0\ntinker_cookbook==0.5.10.dev0+g6daabe0\ntml-renderers==0.2.1\ntokenizers==0.23.3\ntorch==2.15.0+cpu\ntqdm==4.70.1\ntransformers==5.22.1\ntruststore==0.10.5\ntyper==0.27.3\ntyping-inspection==0.4.4\ntyping_extensions==4.16.0\ntzdata==2026.6\nurllib3==2.8.0\nxxhash==4.0.2\nyarl==1.25.1\nzstandard==0.25.0\n=== TINKER DOCS ===\n# Offline snapshots\n\nThe workspace has no network, so the Tinker documentation, the Tinker SDK, the Tinker Cookbook and the source of Pi are cloned here. In the documentation and the cookbook, a few mentions of third-party benchmarks are generalised and two benchmark-specific files are left out; everything else is as published.\n\n## Tinker documentation (`docs/tinker/`)\n\n- Fetched on 2 November 2026 from https://tinker-docs.thinkingmachines.ai/, following the site's `llms.txt` index (copied as `llms.txt`).\n- `llms-full.txt` is the whole site in one file.\n- Every page is also a separate file at the same path as its URL: `https://tinker-docs.thinkingmachines.ai/<path>/index.md` is `docs/tinker/<path>/index.md`. Links inside pages still point at the site.\n- The API reference pages were generated from the Tinker SDK 0.34.0 at commit `64eef5e00c4dc4f55ef6521e14defde58c891c52` and the cookbook at commit `4a3a2829190b45999021e423bc90b7523108edf4`, as each page states.\n",21074,"/workspace/repo/docs/cookbook/tinker_cookbook/recipes/harbor_rl/harbor_tools_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/harbor_rl/scripts/.gitignore\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/harbor_rl/scripts/eval_harbor_rl.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/harbor_rl/train.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/prompt_distillation/README.md\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/prompt_distillation/create_data.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/prompt_distillation/train.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/README.md\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/__init__.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/benchmark.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/datasets.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/eval.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/run_continual_learning.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/sdft_test.py\n/workspace/repo/docs/cookbook/tinker_cookbook/recipes/sdft/train.py"],"d":0.5}]},{"t":288.5,"$":0.0363,"c":[{"n":"bash","a":"for f in \\\n    docs/cookbook/tinker_cookbook/recipes/sdft/README.md \\\n    docs/cookbook/tinker_cookbook/distillation/sdft.py \\\n    docs/cookbook/tinker_cookbook/recipes/distillation/README.md \\\n    docs/cookbook/tinker_cookbook/distillation/train_on_policy.py \\\n    docs/cookbook/tinker_cookbook/recipes/distillation/on_policy_distillation_harbor_multi_turn.py \\\n    docs/cookbook/tinker_cookbook/recipes/prompt_distillation/README.md \\\n    docs/cookbook/tinker_cookbook/hyperparam_utils.py \\\n    docs/cookbook/tinker_cookbook/model_info.py; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["==================== docs/cookbook/tinker_cookbook/recipes/sdft/README.md ====================\n# Self-Distillation Fine-Tuning (SDFT)\n\nThis recipe implements the SDFT algorithm from [\"Self-Distillation Enables Continual Learning\"](https://arxiv.org/abs/2601.19897) (Shenfeld et al., 2026) using Tinker. SDFT is an on-policy distillation method that learns new skills from demonstrations while preserving prior capabilities — addressing catastrophic forgetting in sequential fine-tuning.\n\nThis implementation does not cover learning from environment feedback, as explored in other self-distillation methods such as [SDPO](https://arxiv.org/abs/2601.20802). We recommend using this implementation to learn from demonstrations, hints, guidelines, or other forms of fixed context.\n\n**Model compatibility note:** the original paper and released demonstrations target Qwen2.5-style instruct models. We keep this recipe as a reference implementation of SDFT, but it is likely to work poorly out of the box with Qwen3.5/3.6 long-thinking models unless the SFT demonstrations are regenerated for those models.\n\n## Algorithm\n\n### What the paper does\n\nSDFT uses the same model in two roles with different prompts:\n\n1. **Teacher** sees the question + golden answer as an in-context demonstration\n2. **Student** sees only the question and generates a completion on-policy\n3. The loss minimizes forward KL divergence between teacher and student distributions at each token position of the student's completion:\n\n$$\\mathcal{L} = \\frac{1}{T} \\sum_{t=1}^{T} \\text{KL}\\big(P_{\\text{teacher}}(\\cdot \\mid t) \\| P_{\\text{student}}(\\cdot \\mid t)\\big)$$\n\nwhere $T$ is the number of completion tokens, and the KL at each position sums over the **full vocabulary** (~150K tokens).\n\nBoth teacher and student start from the same base model weights. The paper maintains the teacher as an EMA (Exponential Moving Average) of the student, updated every step with `alpha=0.01` — so the teacher slowly tracks the student's learning while providing stable distillation targets.\n\n### What we implement in Tinker\n\nOur Tinker implementation differs from the paper in two ways:\n\n1. **Top-K instead of full-vocabulary KL.** The Tinker API does not expose full-vocabulary logits. Instead, we use Tinker's [top-K distillation API](https://tinker-docs.thinkingmachines.ai/tinker/losses) (`topk_prompt_logprobs`) to recover the teacher's top-K token distribution at each position, and train with `cross_entropy` loss:\n\n",26389,"\n\ndef warn_if_renderer_not_recommended(model_name: str, renderer_name: str | None) -> None:\n    \"\"\"Log a warning if ``renderer_name`` is not recommended for ``model_name``.\n\n    Silently returns if ``renderer_name`` is ``None`` (caller is using the\n    default) or if ``model_name`` is not in the model registry.\n\n    Args:\n        model_name (str): HuggingFace model identifier.\n        renderer_name (str | None): Renderer name to check, or ``None`` to skip.\n    \"\"\"\n    if renderer_name is None:\n        return\n    try:\n        recommended = get_recommended_renderer_names(model_name)\n    except (ConfigurationError, KeyError, ValueError):\n        # Unknown model — nothing to validate against.\n        return\n    if renderer_name not in recommended:\n        logger.warning(\n            \"Renderer %r is not recommended for model %r. \"\n            \"Recommended renderer(s): %s. \"\n            \"Using an incompatible renderer can silently degrade training quality \"\n            \"(e.g., prefilling tokens the model was never trained on).\",\n            renderer_name,\n            model_name,\n            \", \".join(repr(r) for r in recommended),\n        )"],"d":0.5}]},{"t":299.8,"$":0.0341,"c":[{"n":"bash","a":"tail -n +120 /workspace/repo/docs/cookbook/tinker_cookbook/distillation/sdft.py\necho \"==================== distillation/README.md ====================\"\ncat /workspace/repo/docs/cookbook/tinker_cookbook/recipes/distillation/README.md\necho \"==================== on_policy_distillation_harbor_multi_turn.py ====================\"\ncat /workspace/repo/docs/cookbook/tinker_cookbook/recipes/distillation/on_policy_distillation_harbor_multi_turn.py\necho \"==================== prompt_distillation/README.md ====================\"\ncat /workspace/repo/docs/cookbook/tinker_cookbook/recipes/prompt_distillation/README.md\necho \"==================== hyperparam_utils.py ====================\"\ncat /workspace/repo/docs/cookbook/tinker_cookbook/hyperparam_utils.py","e":0,"o":["        msg: renderers.Message = {\"role\": \"system\", \"content\": system_prompt}  # type: ignore[typeddict-item]\n        messages.append(msg)\n    user_msg: renderers.Message = {\"role\": \"user\", \"content\": teacher_content}  # type: ignore[typeddict-item]\n    messages.append(user_msg)\n    return renderer.build_generation_prompt(messages)\n\n\ndef _extract_completion_tokens(\n    datum: tinker.Datum,\n    teacher_prompt: tinker.ModelInput,\n    max_context_length: int,\n) -> tuple[list[int], int, int, bool]:\n    \"\"\"Extract student completion tokens and compute teacher prompt length.\n\n    Returns (completion_tokens, teacher_prompt_len, completion_start_in_student, was_truncated).\n    completion_tokens may be empty if there are no completion tokens or context overflows.\n    \"\"\"\n    mask = datum.loss_fn_inputs[\"mask\"].to_torch()\n    completion_mask_indices = torch.where(mask > 0)[0]\n    teacher_prompt_len = teacher_prompt.length\n\n    if len(completion_mask_indices) == 0:\n        return [], teacher_prompt_len, 0, False\n\n    # Reconstruct full student sequence (model_input is left-shifted, missing last target)\n    student_full = datum.model_input.append_int(\n        cast(int, datum.loss_fn_inputs[\"target_tokens\"].data[-1])\n    )\n    student_full_tokens = student_full.to_ints()\n    # Completion starts at first mask position + 1 (target is left-shifted)\n    completion_start = int(completion_mask_indices[0].item()) + 1\n    completion_tokens = student_full_tokens[completion_start:]\n\n    available = max_context_length - teacher_prompt_len\n    truncated = False\n    if available <= 0:\n        return [], teacher_prompt_len, completion_start, True\n    if len(completion_tokens) > available:\n        completion_tokens = completion_tokens[:available]\n        truncated = True\n\n    return completion_tokens, teacher_prompt_len, completion_start, truncated\n\n\ndef _build_teacher_forced_sequence(\n    teacher_prompt: tinker.ModelInput,\n    completion_tokens: list[int],\n) -> tinker.ModelInput:\n    \"\"\"Append completion tokens to teacher prompt to form the teacher-forced sequence.\"\"\"\n    teacher_forced = teacher_prompt\n    for token in completion_tokens:\n        teacher_forced = teacher_forced.append_int(token)\n    return teacher_forced\n\n\ndef _completion_positions(mask: torch.Tensor, completion_len: int) -> list[tuple[int, int]]:\n    \"\"\"Return student loss indices and their offsets in the retained teacher suffix.\"\"\"\n    indices: list[int] = torch.where(mask > 0)[0].tolist()\n    if not indices:\n",26352,"    \"\"\"\n    count = 0\n    for _name, shape in _list_param_shapes_from_safetensors_remote(\n        _base_model_name(model_name)\n    ).items():\n        count += np.prod(shape)\n    return float(count)\n\n\ndef get_full_finetune_lr_multiplier(model_name: str) -> float:\n    \"\"\"Get a model-specific LR multiplier for full fine-tuning, proportional to 1/sqrt(param_count).\n\n    Args:\n        model_name: HuggingFace model identifier.\n\n    Returns:\n        The LR multiplier for full fine-tuning.\n    \"\"\"\n    return 1.0 / math.sqrt(get_full_finetune_param_count(model_name))\n\n\ndef get_lora_lr_multiplier(model_name: str) -> float:\n    \"\"\"Get a model-specific multiplier for the LR, when training with LoRA.\n\n    Given two models A and B, and learning rate LR_A that's known to be optimal for A,\n    we can guess an optimal learning rate for B as\n    LR_B = LR_A * get_lora_lr_multiplier(B) / get_lora_lr_multiplier(A)\n\n    Args:\n        model_name: HuggingFace model identifier.\n\n    Returns:\n        The LoRA LR multiplier combining full-finetune scaling and LoRA factor.\n    \"\"\"\n    return get_full_finetune_lr_multiplier(model_name) * get_lora_lr_over_full_finetune_lr(\n        model_name\n    )"],"d":0.2}]},{"t":307.2,"$":0.0346,"c":[{"n":"bash","a":"for f in \\\n    docs/cookbook/tinker_cookbook/recipes/distillation/README.md \\\n    docs/cookbook/tinker_cookbook/recipes/distillation/on_policy_distillation_harbor_multi_turn.py \\\n    docs/cookbook/tinker_cookbook/recipes/distillation/harbor_multiturn.py \\\n    docs/cookbook/tinker_cookbook/recipes/prompt_distillation/README.md; do\n    echo \"==================== $f ====================\"\n    cat \"/workspace/repo/$f\"\ndone","e":0,"o":["==================== docs/cookbook/tinker_cookbook/recipes/distillation/README.md ====================\n# Distillation\n\nDistillation refers to a class of methods where a teacher model is supervising the training of a student model, which can often be more efficient than training the student model in isolation. We provide off-policy and on-policy distillation recipes on top of the [OpenThoughts3](https://huggingface.co/datasets/open-thoughts/OpenThoughts3-1.2M), [DeepMath](https://huggingface.co/datasets/zwhe99/DeepMath-103K), and [Tulu3](https://huggingface.co/datasets/allenai/tulu-3-sft-mixture)* datasets.\n\nSpecifically, we provide the scripts needed to reproduce our experiments from the [On-Policy Distillation](https://thinkingmachines.ai/blog/on-policy-distillation) blog post, which can be run with LoRA using Tinker.\n\n\\* For our post, we regenerated the assistant turns using [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B).\n\n## Distillation for reasoning\n\nOur results can be reproduced by running:\n\n1. Supervised fine-tuning on [OpenThoughts3](https://huggingface.co/datasets/open-thoughts/OpenThoughts3-1.2M)\n2. On-policy distillation on [DeepMath](https://huggingface.co/datasets/zwhe99/DeepMath-103K)\n\n### Supervised fine-tuning\n\nWe observe an AIME'24 score of ~65% using a rank-128 LoRA after 3000 steps. We use a learning rate of 1e-3 with LoRA and 1e-4 with full fine-tuning.\n\n```bash\npython -m tinker_cookbook.recipes.distillation.off_policy_reasoning \\\n    model_name=Qwen/Qwen3.5-9B-Base \\\n    learning_rate=1e-3 \\\n    batch_size=128 \\\n    lora_rank=128 \\\n    wandb_project=cookbook_distillation\n```\n\n### On-policy distillation\n\nWe observe an AIME'24 score of ~76.7% using a rank-128 LoRA after 200 steps with 16k-token rollouts. For on-policy distillation experiments, we use a learning rate of 1e-4 with LoRA and 5e-5 with full fine-tuning.\n\n```bash\npython -m tinker_cookbook.recipes.distillation.on_policy_distillation \\\n    model_name=Qwen/Qwen3.5-9B-Base \\\n    teacher_model=Qwen/Qwen3.5-9B \\\n    load_checkpoint_path=tinker://session-1:train:0/weights/final \\\n    dataset=deepmath \\\n    learning_rate=1e-4 \\\n    groups_per_batch=512 \\\n    lora_rank=128 \\\n    max_tokens=16384 \\\n    wandb_project=cookbook_distillation\n```\n\nThis script can also be used to replicate the experiments in our Discussion section, after you have run RL to obtain an appropriate checkpoint for the teacher model.\n\n",17137,"- Fine-tune the student model for language classification\n\n### Step 3: Test Your Model\n\nOnce training is complete, you can test your distilled model by sampling from the trained model to verify its performance on language classification tasks.\n\n## Advanced Configuration\n\nThe prompt distillation recipe can be customized for different scenarios:\n\n- **Teacher model selection**: Choose different base models based on your requirements\n- **Sampling strategies**: Adjust temperature and other generation parameters\n- **Data volume**: Scale the number of generated examples based on your needs\n- **Training hyperparameters**: Fine-tune learning rates and other training settings\n\n[1] Askell, A., Bai, Y., Chen, A., Drain, D., Ganguli, D., Henighan, T., Jones, A., Joseph, N., Mann, B., DasSarma, N., Elhage, N., Hatfield-Dodds, Z., Hernandez, D., Kernion, J., Ndousse, K., Olsson, C., Amodei, D., Brown, T., Clark, J., McCandlish, S., Olah, C., & Kaplan, J. (2021). A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861.\n\n[2] Snell, C., Klein, D., & Zhong, R. (2022). Learning by distilling context. arXiv preprint arXiv:2209.15189."],"d":0.2}]}],"parts":[150,128]}