Expand description
Rust-native serving API for TokTier.
The crate owns artifact verification, exact one-shot and batch encoding,
and stateful append repair. Request execution does not require Python,
PyO3, or PyTorch. Accelerated routes are admitted only from shipped,
digest-bound certification data and otherwise fall back to the frozen
Hugging Face tokenizers reference implementation.
Modules§
- chunked
- Chunk-parallel encode of one long request on the corrected CPU route.
Structs§
- Artifact
Identity - Content and provenance identity of a verified tokenizer artifact.
- Artifact
Inspection - Verified cache facts for diagnostics and control planes.
- Artifact
Manager - Rust-native artifact lifecycle manager.
- Artifact
Manager Builder - Builder for the shareable artifact lifecycle manager.
- Bearer
Token - Secret bearer material.
DebugandDisplaydeliberately redact it. - Behavior
Version - The version of one text-semantics unit, as this binary reads it and as the certification evidence recorded it.
- Bundle
File Inspection - One regular file declared by an air-gap bundle.
- Bundle
Inspection - Facts authenticated by a bundle’s domain-separated root digest.
- Cuda
Facts - Non-invasive CUDA probe result. Probe failure is data, not a panic.
- Decode
Options - Options for decode.
- Doctor
Facts - Build/runtime facts that can be emitted by a control plane without parsing human-readable output.
- Encode
Options - Options for a one-shot encode. Both fields default to
false. - Encoding
- One tokenization result and its typed execution facts.
- Environment
Token - Reads one explicitly named environment variable on demand.
- Error
- Structured public error. Callers should branch on
Error::code, not on the human-readable message. - Execution
Facts - Facts for one completed encode or append operation.
- Local
Artifact - A local tokenizer whose required bytes were checked against the shipped manifest during this process.
- Ragged
Encoding - Ragged batch stored as one values allocation plus monotone row offsets.
- Revision
- Immutable repository revision accepted by network acquisition.
- Route
Plan - Immutable route selected at tokenizer construction.
- Runtime
- Immutable root object. Clone is cheap and thread-safe.
- Runtime
Build Facts - Exact build identity embedded by the Python-free Rust facade.
- Runtime
Builder - Builder for the immutable Rust runtime.
- Serving
Limits - Resource limits for an executor-neutral serving queue.
- Serving
Pool - Cloneable submission handle. Dropping the final pool drains accepted work.
- Serving
Pool Builder - Builder requiring at least one already verified tokenizer/device handle.
- Serving
Request - Executor-neutral request: both
Futureand blocking wait are available. - Serving
Response - A value produced by the bounded scheduling layer.
- Serving
Session - Single-writer session adapter. Appends are serialized by its private lock; no store transaction or lock is held across a Future poll/await point.
- Serving
Timings - Separately-accounted queue and engine timings for one response.
- Session
- One non-cloneable, single-writer agent session.
- Session
Stats - Compact observability snapshot for one named session.
- Store
Stats - Public snapshot of the native state-store counters.
- Token
Buffer - Immutable, cheaply cloneable ownership of one continuous token allocation. A borrowed slice cannot outlive its owning buffer:
- Token
Patch - Exact suffix replacement produced by an incremental append.
- Tokenizer
- A verified tokenizer and immutable route. Clone is cheap; sessions retain their own single-writer handles.
Enums§
- Artifact
Source - Source used when a verified cache object is absent.
- Backend
- Backend that actually produced token IDs.
- Certification
- Certification status attached to one admitted route.
- Device
- Requested execution device.
- Device
Failure Policy - What happens only when a request returns an execution error after its own ordered GPU -> CPU -> HF fallback chain is exhausted.
- Error
Code - Stable machine-readable public error code.
- GpuDelivery
- CUDA kernel delivery preference.
- Policy
- Runtime certification policy.
- Reason
Code - Stable route/fallback reason identifier.
Constants§
- DEPENDENCY_
CLOSURE - How the whole compiled closure of this build compares with the graph
the certification evidence was taken on:
"verified", or a line beginning"unlocated: "when no governing lockfile could be named, or one beginning"mismatched: "naming every package that is not the judged one. - ORACLE
- Version of the frozen native Hugging Face oracle.
Traits§
- Secret
Provider - Supplies authentication only at request construction. Implementations must not persist credentials in cache paths or diagnostics.
Functions§
- export_
bundle - Write a deterministic v1 bundle from verified regular files.
- import_
bundle - Verify a v1 archive into private staging and atomically install its alias.
- inspect_
bundle - Verify an archive and all declared file bytes without installing it.
- verify_
local_ command - The whole command, from its arguments to its report.
Type Aliases§
- Result
- Public result alias.