Architecture
Python applications use one typed interface to make direct calls to the selected provider API.
Core
llm-api-adapter==0.11.0 provides UniversalLLMAPIAdapter, shared message and response types, error handling, and the default requests transport. Core includes built-in adapters for the following providers.
Core also provides the compatible endpoint modes. The caller supplies the API root and selects the protocol and model.
Provider packages
Optional packages are installed and released independently. They register with Core through the llm_api_adapter.organizations entry-point group and ship their own adapters and model registries.
Provider packages can prepare requests for their APIs. For example,Mistral can extract the text of a PDF through its OCR endpoint before sending that text to the chat model. See provider setup for the package and credentials to use.
Request flow
- The application selects a provider and model and passes credentials and messages to the adapter.
- The adapter applies the registered model's request rules and builds the provider-specific payload.
- The transport makes the HTTP request. Async calls use HTTPX, which is also available for sync calls.
- The adapter returns a
ChatResponseor streams text and reports the completed response throughon_done.
See the Python API and examples.
Model registries
The installed packages supply runtime model metadata and request rules. The website reads a static snapshot from the published wheels, captured on. Each model page records the source package version, known limits, pricing, and capability exceptions.
Browse the model catalog, download the snapshot, or read about capability and cost limits.