Skip to main content

Crate toktier

Crate toktier 

Source
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§

ArtifactIdentity
Content and provenance identity of a verified tokenizer artifact.
ArtifactInspection
Verified cache facts for diagnostics and control planes.
ArtifactManager
Rust-native artifact lifecycle manager.
ArtifactManagerBuilder
Builder for the shareable artifact lifecycle manager.
BearerToken
Secret bearer material. Debug and Display deliberately redact it.
BehaviorVersion
The version of one text-semantics unit, as this binary reads it and as the certification evidence recorded it.
BundleFileInspection
One regular file declared by an air-gap bundle.
BundleInspection
Facts authenticated by a bundle’s domain-separated root digest.
CudaFacts
Non-invasive CUDA probe result. Probe failure is data, not a panic.
DecodeOptions
Options for decode.
DoctorFacts
Build/runtime facts that can be emitted by a control plane without parsing human-readable output.
EncodeOptions
Options for a one-shot encode. Both fields default to false.
Encoding
One tokenization result and its typed execution facts.
EnvironmentToken
Reads one explicitly named environment variable on demand.
Error
Structured public error. Callers should branch on Error::code, not on the human-readable message.
ExecutionFacts
Facts for one completed encode or append operation.
LocalArtifact
A local tokenizer whose required bytes were checked against the shipped manifest during this process.
RaggedEncoding
Ragged batch stored as one values allocation plus monotone row offsets.
Revision
Immutable repository revision accepted by network acquisition.
RoutePlan
Immutable route selected at tokenizer construction.
Runtime
Immutable root object. Clone is cheap and thread-safe.
RuntimeBuildFacts
Exact build identity embedded by the Python-free Rust facade.
RuntimeBuilder
Builder for the immutable Rust runtime.
ServingLimits
Resource limits for an executor-neutral serving queue.
ServingPool
Cloneable submission handle. Dropping the final pool drains accepted work.
ServingPoolBuilder
Builder requiring at least one already verified tokenizer/device handle.
ServingRequest
Executor-neutral request: both Future and blocking wait are available.
ServingResponse
A value produced by the bounded scheduling layer.
ServingSession
Single-writer session adapter. Appends are serialized by its private lock; no store transaction or lock is held across a Future poll/await point.
ServingTimings
Separately-accounted queue and engine timings for one response.
Session
One non-cloneable, single-writer agent session.
SessionStats
Compact observability snapshot for one named session.
StoreStats
Public snapshot of the native state-store counters.
TokenBuffer
Immutable, cheaply cloneable ownership of one continuous token allocation. A borrowed slice cannot outlive its owning buffer:
TokenPatch
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§

ArtifactSource
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.
DeviceFailurePolicy
What happens only when a request returns an execution error after its own ordered GPU -> CPU -> HF fallback chain is exhausted.
ErrorCode
Stable machine-readable public error code.
GpuDelivery
CUDA kernel delivery preference.
Policy
Runtime certification policy.
ReasonCode
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§

SecretProvider
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.