mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 10:54:19 +00:00
# What does this PR do? update docs for adding new API providers 
2.4 KiB
2.4 KiB
Adding a New API Provider
This guide will walk you through the process of adding a new API provider to Llama Stack.
Getting Started
-
Choose Your API Category
- Determine which API category your provider belongs to (Inference, Safety, Agents, VectorIO)
- Review the core concepts of Llama Stack in the concepts guide
-
Determine Provider Type
- Remote Provider: Makes requests to external services
- Inline Provider: Executes implementation locally
Reference existing implementations:
- {repopath}
Remote Providers::llama_stack/providers/remote
- {repopath}
Inline Providers::llama_stack/providers/inline
Example PRs:
-
Register Your Provider
- Add your provider to the appropriate {repopath}
Registry::llama_stack/providers/registry/
- Specify any required pip dependencies
- Add your provider to the appropriate {repopath}
-
Integration
- Update the run.yaml file to include your provider
- To make your provider a default option or create a new distribution, look at the teamplates in {repopath}
llama_stack/templates/
and run {repopath}llama_stack/scripts/distro_codegen.py
- Example PRs:
Testing Guidelines
1. Integration Testing
- Create integration tests that use real provider instances and configurations
- For remote services, test actual API interactions
- Avoid mocking at the provider level
- Reference examples in {repopath}
tests/client-sdk
2. Unit Testing (Optional)
- Add unit tests for provider-specific functionality
- See examples in {repopath}
llama_stack/providers/tests/inference/test_text_inference.py
3. End-to-End Testing
- Start a Llama Stack server with your new provider
- Test using client requests
- Verify compatibility with existing client scripts in the llama-stack-apps repository
- Document which scripts are compatible with your provider
Submitting Your PR
- Ensure all tests pass
- Include a comprehensive test plan in your PR summary
- Document any known limitations or considerations
- Submit your pull request for review