rlcli — A CLI Interface for Continual Learning
rlcli runs fused GSPO on your own GPUs in one forward-backward call, the loss hosted Tinker does not serve. Backed by SkyRL, driven from your terminal.
rlcli is a Python CLI that runs fused RL losses like GSPO on your own GPUs in a single forward_backward call. Hosted Tinker does not serve GSPO natively: reproducing it there costs a 2-pass round-trip (fetch logprobs, compute the loss client-side, ship the reweighted batch back). rlcli gives you the fused 1-pass path locally, and our benchmark measures a 23% step-time reduction and 29.8% throughput gain on Qwen3-4B-Instruct-2507.
It is also the missing front door for the whole stack: the official tinker CLI has no train verb, and SkyRL has no CLI. rlcli wires them together so you can serve a model, run SFT or RL, and sample from checkpoints without leaving your terminal.
# serve a Tinker-API training server on your hardware
rlcli serve start --base-model Qwen/Qwen3-4B-Instruct-2507 --backend fsdp --gpus 8
# supervised fine-tune on your own conversations
rlcli train sl --model Qwen/Qwen3-4B-Instruct-2507 --dataset conversations.jsonl
# RL with the fused GSPO loss — one forward_backward call, not the 2-pass custom-loss path
rlcli train rl --model Qwen/Qwen3-4B-Instruct-2507 --loss gspo
# agent RL in sandboxed environments: Docker container + instruction + test script = reward
rlcli train harbor --model Qwen/Qwen3-4B-Instruct-2507 --loss gspo --dataset terminal-bench@2.0
# import your agent's chat dumps and fine-tune on them, all on your hardware
rlcli import prod-traces.jsonl -f openai | rlcli train sl --dataset - --model Qwen/Qwen3-4B-Instruct-2507
Docs: docs.polygramme.com · Install: pip install polygramme-rlcli (the rlcli command; PyPI reserves the bare name — not to be confused with rl-cli, Runloop's CLI).
Benchmarks
Measured, with receipts in benchmarks/:
- Fused GSPO vs 2-pass (json): same A100, same frozen batch — 12.9s vs 16.8s per step (−23%), 586 vs 451 tok/s (+29.8%).
- GSM8K end-to-end (json): Qwen3-4B-Instruct-2507, 25 GSPO steps — 85.29% → 87.11% on the full 1,319-problem test set, for $3.52 of rented A100 time.
- Cold start on a single L4: Qwen3-0.6B goes from ~2% to ~60%+ GSM8K train accuracy in 40 GSPO steps.
How it works
rlcli servemanages a SkyRL Tinker server in its own uv venv (~/.rlcli/server-venv) — required because skyrl capstinker<=0.24.1while the client uses 0.25.0; they meet over HTTP.- Backends:
jax(runs anywhere, CPU ok),fsdp/megatron(Linux + CUDA; serve the full loss set incl.gspo,cispo,dppo,ppo_critic). rlcli traininvokes pinned tinker-cookbook recipes programmatically.--loss gspoon a JAX server fails fast with a clear error.rlcli train harborruns Harbor-format tasks (Dockerfile + instruction + test script) on your local Docker daemon — the test verdict is the reward. No cloud sandbox account needed.rlcli checkpoint / run / sessionpass through to the official tinker CLI, pointed at your server.- Everything stays in your environment: traces, data, training, weights.
Dataset format (train sl)
One JSON object per line:
{"messages": [{"role": "user", "content": "hi"}, {"role": "assistant", "content": "hello"}]}
rlcli import produces this from common chat dumps: -f openai (chat-completions
dumps; tool-call turns dropped), -f anthropic (Messages API dumps; content blocks
flattened, top-level system kept), -f messages (already-shaped, roles normalized
— human→user, ai→assistant). Imported traces feed SFT/distillation; RL needs
an environment and reward (see roadmap).
Development
uv venv && uv pip install -e ".[dev]"
pytest # includes the wire-compat test for extended losses
uv pip install -e ".[train]" "tinker-cookbook @ git+https://github.com/thinking-machines-lab/tinker-cookbook@f46eddde86e5397138917516a6c69d2ecbf538b1" # train commands (PyPI forbids the git pin inside the extra)
Policy: tinker and tinker-cookbook are pinned dependencies; we do not carry patches against them — compatibility lives in rlcli/compat.py and is re-verified by tests on every pin bump.
Roadmap
Trace import from more sources (LangSmith with verdict-based rewards) → PII redaction → on-policy distillation and multi-tenant LoRA → trace-synthesized environments → the continual-learning loop.
Apache-2.0.
Metadata
Release files for polygramme-rlcli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polygramme_rlcli-0.1.0.tar.gz | 793.4 kB | Without provenance | Details for polygramme_rlcli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polygramme_rlcli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for polygramme_rlcli-0.1.0-py3-none-any.whl |
Total release size: 822.5 kB
Release files / polygramme_rlcli-0.1.0.tar.gz
| Download URL | polygramme_rlcli-0.1.0.tar.gz |
|---|---|
| Size | 793.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a625f724cabc37b3a9e58336ca1122d1ad94dde0a038529cc94a9ae6c38c9439
|
|
BLAKE2b-256 checksum How to use checksums |
0f9f530fff0c023eb17d2247505fb6a0baa10be1a17350f22a428f0f2ce8844b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / polygramme_rlcli-0.1.0-py3-none-any.whl
| Download URL | polygramme_rlcli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
923ea822bf4aacec88806556d330eefe780fc746976dcdef2d0093e4fbe859df
|
|
BLAKE2b-256 checksum How to use checksums |
5e98cdf9c0c8cb56c344161bbe714270b8eb5a3308fe0b29d39f8c182bde0dbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for polygramme-rlcli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.