Metadata-Version: 2.5
Name: shipyard-rl
Version: 0.1.0
Summary: Post-training on Harbor jobs: a config sets up a run, and a run is its record.
Project-URL: Repository, https://github.com/ghidav/shipyard
Project-URL: Issues, https://github.com/ghidav/shipyard/issues
Author: Davide Ghilardi
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,cispo,dapo,gepa,grpo,harbor,llm,post-training,reinforcement-learning,tinker
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: harbor[modal]<0.25,>=0.23
Requires-Dist: harness-proxy==0.1.0
Requires-Dist: litellm>=1.103
Requires-Dist: pydantic>=2.9
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rich>=14.1
Requires-Dist: shortuuid>=1.0.13
Requires-Dist: tinker-cookbook<0.7,>=0.6
Requires-Dist: tinker<0.39,>=0.38
Requires-Dist: tomli-w>=1.0
Requires-Dist: typer>=0.16
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Provides-Extra: gepa
Requires-Dist: gepa>=0.1.4; extra == 'gepa'
Provides-Extra: together
Requires-Dist: dockerfile-parse>=2.0.1; extra == 'together'
Requires-Dist: harness-proxy[together]==0.1.0; extra == 'together'
Requires-Dist: together-sandbox<5,>=4.1; extra == 'together'
Provides-Extra: wandb
Requires-Dist: wandb>=0.21; extra == 'wandb'
Description-Content-Type: text/markdown

# Shipyard

Post-training framework for AI agents on Harbor tasks.

## Installation

Requires **Python 3.12+** and [uv](https://github.com/astral-sh/uv):

```sh
uv tool install shipyard-rl
```

## Quickstart

The recipes train on [Tinker](https://thinkingmachines.ai/tinker/) and run their trials in [Modal](https://modal.com)'s sandboxes, whose calls reach the model through a Cloudflare tunnel this machine opens: install [`cloudflared`](https://github.com/cloudflare/cloudflared), or keep Docker running.

```sh
shipyard init                                                    # copy the recipes and .env.example here
cp .env.example .env                                             # then set TINKER_API_KEY in .env
uvx modal setup                                                  # log in to Modal, or set its keys in .env
uvx harbor@0.24.0 datasets download reasoning-gym-easy -o tasks  # the recipes' tasks, in tasks/reasoning-gym-easy/
shipyard run recipes/dapo                                        # the run writes runs/dapo__<id>/
```

As shipped, the run takes about 1 h 45 min and costs about $20: $15 of Tinker and $5 of Modal, measured in November 2026. Add `--recipe.steps 1` to stop after the first step, about 10 minutes and under $2.

> [!IMPORTANT]
> Add `--dry` to see every setting the run would use, with each default `run.toml` leaves marked, and to check the run without starting it.

> [!TIP]
> For anything longer than a smoke test, start the run on a cloud VM rather than a laptop, for example in US East, and inside `tmux` so it outlives your SSH session. Every model call passes through the proxy on the machine that started the run, and that machine uploads each update's training data, so a laptop's distance, uplink and sleep slow or stall the whole run.

## Customizing


- **Settings:** a recipe's settings can be updated in its `run.toml` (model, harnesses, data, learning rate, LoRA rank, ...); you can overwrite them using `--table.key VALUE` on `shipyard run`.
- **Algorithm:** a recipe defines a `trainer.py` where it subclasses `Trainer` and writes `step` from the primitives `draw`, `rollout` and `update`, giving the sequences their advantages in between; the core holds no algorithm of its own (see [`src/shipyard`](src/shipyard/README.md)).
- **Recipes:** GRPO, DAPO (also with its rollouts overlapping its updates), rejection-sampling fine-tuning, on-policy distillation and GEPA, in [`recipes/`](recipes/README.md).

The trainer updates on exactly what the agent sampled: `harness-proxy` serves the model to the harnesses, and records every call's token ids and logprobs.

## Layout

```
src/shipyard/            the Trainer API, with models/, jobs/ and run/
packages/harness-proxy/  serves the agent to its harnesses, and records every call
recipes/                 the built-in recipes
```

## License

Apache-2.0. See [LICENSE](LICENSE).
