Skip to content

SDK reference

Generated from the docstrings of every public symbol in anyinfer — coverage is a CI gate, so nothing here is an empty page. The core surface is importable from the top-level package; the local, serve, and testing subsystems from their subpackages:

import anyinfer as ai
Page Covers
Clients and streams Client, AsyncClient, streams, ProviderSettings, the @tool decorator
Requests and messages GenerationRequest, messages, sampling, schemas, tool specs
Results and stream events Generation, usage, timing, the typed event stream
Routing Route, Retry, target resolution
Capabilities Provenance-tagged model capabilities and pricing
Context reduction Fitting a document corpus to a token budget
Telemetry and redaction Observers, telemetry events, redaction, the OpenTelemetry bridge
Registry, catalog, credentials Provider descriptors, the model catalog, credential resolvers
Configuration The shared JSON loader and validated config object
Local inference anyinfer.local: hardware, backends, tuning, downloads, supervision
Serve anyinfer.serve: the embeddable frontend and its OpenAI codec
Testing utilities anyinfer.testing: fakes, cassettes, the conformance suite
Errors The exception hierarchy and its structured fields

If you are looking for how to use these rather than their signatures, start with the concepts and guides.