Repository navigation
v0.1.0
What's New
tokin 0.1.0 is the first beta: a gateway that makes any agent harness token-native. A harness keeps speaking OpenAI chat completions to a per-session URL; tokin keeps each session as a tree of turns, sends the inference engine only token ids, and hands a trainer every rollout exactly as sampled. It has been run with mini-swe-agent, opencode and pi, and used to train pi with slime.
Features
- Sessions as trees of turns. Each request attaches to the deepest earlier turn it continues; retries, edits and compactions branch or start a new root instead of re-encoding what was sampled (#6, #77, #98, #124, #129, #138).
- Token-in, token-out rendering. Per-family chat templates render only what a request adds, for Qwen2.5–Qwen3.8 and GLM-4.5–GLM-5.3, and each family's reasoning and tool-call grammar is parsed back into an assistant message (#15, #20, #23, #27, #122, #139, #156).
- An OpenAI-compatible server.
POST /sessionsopens a session at its own/sessions/{id}/v1, with streaming, cancellation when a harness hangs up, and the request fields common harnesses send (#85, #86, #88, #89, #97, #102, #109). - What a trainer needs, per position. Token ids, loss mask and logprobs, plus the sampler's top-p support and top logprobs, the routed experts for MoE routing replay, and the weight version that sampled each token; a session packs into one safetensors payload (#34, #73, #99, #150, #151).
- SGLang backend. Session-fixed sampling params, resumption of aborted generations, router-aware routing keys and context length, and per-generation prefix-cache and speculative counts (#33, #90, #149, #152, #157, #160).
- CLI.
tokin serve,tokin openandtokin collect(#93, #159, #177).
Examples
examples/harbor_eval: evaluate mini-swe-agent, opencode or pi through tokin on Harbor's Terminal-Bench 2.1 and SWE-bench Verified (#100, #108, #164).examples/pi_mimo_rl: fully asynchronous RL of pi on MiMo-V2.6-RL-oss with slime, for Qwen3.8-27B and Qwen3.5-35B-A3B (#166, #176).
Scope of this beta
- Harness API: Any harnesses with OpenAI chat completions interface.
- Inference engine: SGLang only.
- Text only. Multi-modality to come.
Full Changelog: https://github.com/open-rollout/tokin/commits/v0.1.0