Skip to content

v0.0.1

Choose a tag to compare

@Lawhy Lawhy released this 17 Sep 00:45
· 132 commits to main since this release
a3d5473

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

  • ChatTemplate renders 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.parse reads the sampled text back into an OpenAI assistant message: reasoning in reasoning_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_template finds a family by name, by checkpoint id, or by module:Class for 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

  • README architecture diagram; contributor guide in AGENTS.md (#4, #7, #9)

Maintenance

  • Packaging, lint, types, CI, trusted publishing to PyPI (#1, #3, #13, #19, #25, #31)

Full Changelog: https://github.com/camel-ai/tokin/commits/v0.0.1