llama-stack-api
API and Provider specifications for Llama Stack - a lightweight package with protocol definitions and provider specs.
Overview
llama-stack-api is a minimal dependency package that contains:
- API Protocol Definitions: Type-safe protocol definitions for all Llama Stack APIs (inference, agents, safety, etc.)
- Provider Specifications: Provider spec definitions for building custom providers
- Data Types: Shared data types and models used across the Llama Stack ecosystem
- Type Utilities: Strong typing utilities and schema validation
What This Package Does NOT Include
- Server implementation (see
llama-stackpackage) - Provider implementations (see
llama-stackpackage) - CLI tools (see
llama-stackpackage) - Runtime orchestration (see
llama-stackpackage)
Use Cases
This package is designed for:
- Third-party Provider Developers: Build custom providers without depending on the full Llama Stack server
- Client Library Authors: Use type definitions without server dependencies
- Documentation Generation: Generate API docs from protocol definitions
- Type Checking: Validate implementations against the official specs
Installation
pip install llama-stack-api
Or with uv:
uv pip install llama-stack-api
Dependencies
Minimal dependencies:
openai>=2.5.0- For OpenAI-compatible typesfastapi>=0.115.0,<1.0- For FastAPI route definitionspydantic>=2.11.9- For data validation and serializationjsonschema- For JSON schema utilitiesopentelemetry-sdk>=1.30.0- For telemetryopentelemetry-exporter-otlp-proto-http>=1.30.0- For OTLP export
Versioning
This package follows semantic versioning independently from the main llama-stack package:
- Patch versions (0.1.x): Documentation, internal improvements
- Minor versions (0.x.0): New APIs, backward-compatible changes
- Major versions (x.0.0): Breaking changes to existing APIs
The version is determined dynamically via setuptools-scm at build time.
Usage Example
from llama_stack_api import (
Api,
Inference,
InlineProviderSpec,
OpenAIChatCompletionRequestWithExtraBody,
)
# Use protocol definitions for type checking
class MyInferenceProvider(Inference):
async def openai_chat_completion(
self, request: OpenAIChatCompletionRequestWithExtraBody
):
# Your implementation
pass
# Define provider specifications
my_provider_spec = InlineProviderSpec(
api=Api.inference,
provider_type="inline::my-provider",
pip_packages=["my-dependencies"],
module="my_package.providers.inference",
config_class="my_package.providers.inference.MyConfig",
)
Relationship to llama-stack
The main llama-stack package depends on llama-stack-api and provides:
- Full server implementation
- Built-in provider implementations
- CLI tools for running and managing stacks
- Runtime provider resolution and orchestration
Contributing
See the main Llama Stack repository for contribution guidelines.
License
MIT License - see LICENSE file for details.
Links
Metadata
Release files for llama-stack-api 0.7.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_stack_api-0.7.3.tar.gz | 135.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_stack_api-0.7.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 295.1 kB
Release files / llama_stack_api-0.7.3.tar.gz
| Download URL | llama_stack_api-0.7.3.tar.gz |
|---|---|
| Size | 135.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ad83caa3ae9917d7d3af9d465f3b41078ac1c452a9bfca540e292fadc4c3346
|
|
BLAKE2b-256 checksum How to use checksums |
7ca53dab6fb560aa99a6bda659da71a83a03ef411cba493c13a86098cf944781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency logRelease files / llama_stack_api-0.7.3-py3-none-any.whl
| Download URL | llama_stack_api-0.7.3-py3-none-any.whl |
|---|---|
| Size | 159.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbd9f06632b50661aa536f3c9f55d064e236287488c1909c14abb429dc143bb9
|
|
BLAKE2b-256 checksum How to use checksums |
bcee1cb8febc80e02e00289dd871a090528babfb71d111779ab384cfdf88efcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency log