Repository navigation
Releases
Releases · open-rollout/tokin
v0.1.1
What's New
Features
- Serve OpenAI's Responses API at
/v1/responsesby translating it onto chat completions. Streaming works, as do custom and namespace tools, and later developer and system messages are tagged. Unsupported item and tool types are refused with a message that names the type (#184, #186, #187) - Serve images in user messages for
qwen35andqwen38. Each image is rendered as one pad, sized from the checkpoint's image processor, and expanded into its positions in the rollout. Sessions save the image URLs and counts for the trainer (#200, #202, #203, #204, #205) - sglang gets images as
image_data, and tokin refuses any answer where sglang silently re-tokenized the prompt instead of expanding the pads (#201) harbor_evalruns Codex through tokin's Responses API, and its results are added to the example (#188, #191)
Bug Fixes
- When sglang aborts a request itself (e.g. "Abort in waiting queue"), the turn is now resumed instead of failing with a 500 (#206)
Refactoring
- Each harness API now writes its own stream keep-alive and error events, and the Responses request types its own keys (#183, #185)
Documentation
- The README's Codex config turns off web search and reasoning summaries; without that, the first request fails with a 400 (#197)
- Fixed the TITO A/B number quoted in
harbor_evaland added a blog post badge (#181, #182)
Maintenance
Full Changelog: v0.1.0...v0.1.1
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
v0.0.1
What's New
First release. tokin ships as a library: the chat-template layer a token-in/token-out gateway needs. The /v1/chat/completions server is not in this release.
Features
ChatTemplaterenders a conversation with the model's own Hugging Face chat template, and renders just the increment a new turn adds, so a served prompt is extended rather than rebuilt (#15, #18)ChatTemplate.parsereads the sampled text back into an OpenAI assistant message: reasoning inreasoning_content, tool calls parsed in the family's grammar (#26, #27)- Families for the Qwen mainline, 2.5 through 3.8, and GLM 4.5 through 5.3 (#20, #23, #24)
- Tool-call grammars: Hermes JSON, Qwen
<function=…>XML, GLM<arg_key>pairs; XML argument values are typed by the tool schema (#27) - Tool results are checked against their calls and put in call order before rendering (#29)
get_chat_templatefinds a family by name, by checkpoint id, or bymodule:Classfor a family defined outside the package (#22)Rollout,Turn,Session: the token-level record of a conversation, prompt ids and sampled ids kept apart (#5, #6)
Tests
- Every family is verified against its real tokenizers: 50 checkpoints, 954 cases, including the increment-is-a-suffix property and the parse round-trip (#21)
Documentation
Maintenance
Full Changelog: https://github.com/camel-ai/tokin/commits/v0.0.1