-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add SambaNova provider support #3887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DouweM
merged 7 commits into
pydantic:main
from
Pavanmanikanta98:feat/sambanova-provider
Jan 14, 2026
Merged
Add SambaNova provider support #3887
DouweM
merged 7 commits into
pydantic:main
from
Pavanmanikanta98:feat/sambanova-provider
Jan 14, 2026
+303
−11
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements SambaNova Cloud provider with support for multiple model families including Meta Llama, DeepSeek, Qwen, and Mistral models. - Add SambaNovaProvider class with OpenAI-compatible API - Implement multi-profile support for different model families - Add comprehensive test suite - Update documentation across README, docs/index.md, and docs/models/openai.md - Register provider in inference system Fixes pydantic#3669 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Collaborator
|
thanks for the contribution @Pavanmanikanta98 ! Douwe will take a look when he's back :) |
0a2c294 to
94c7da4
Compare
The documentation in docs/models/openai.md has complete usage examples. This matches the pattern used by Fireworks, Together, and Alibaba providers.
OpenAI-compatible providers (Alibaba, Fireworks, Together, SambaNova) don't need api_key fixtures. Only direct model providers with tests/models/test_*.py files require them.
DouweM
requested changes
Jan 10, 2026
| #> The capital of France is Paris. | ||
| ``` | ||
|
|
||
| ### SambaNova |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will have to be moved if #3941 merges first.
Contributor
Author
|
@DouweM Updated with the correct link to the official SambaNova model catalog documentation. |
Collaborator
|
@Pavanmanikanta98 Thanks Pavan! |
This was referenced Jan 15, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
awaiting author revision
feature
New feature request, or PR implementing a feature (enhancement)
new models
Support for new model(s)
size: M
Medium PR (101-500 weighted lines)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements SambaNova Cloud provider following the same pattern as other OpenAI-compatible providers (Together, Fireworks, Alibaba).
Changes
Core Implementation
SambaNovaProviderclass inpydantic_ai/providers/sambanova.pyProvider[AsyncOpenAI]SAMBANOVA_API_KEY,SAMBANOVA_BASE_URLhttps://api.sambanova.ai/v1Model Support
Meta-Llama-3.1-8B-Instruct,Meta-Llama-3.3-70B-Instruct,Llama-4-Maverick-17B-128E-InstructDeepSeek-R1-0528,DeepSeek-V3-0324,DeepSeek-R1-Distill-Llama-70BQwen3-32BFiles Changed
pydantic_ai/providers/sambanova.py- New provider implementationpydantic_ai/providers/__init__.py- Provider registrationpydantic_ai/models/__init__.py- Added to compatibility type aliasestests/providers/test_sambanova_provider.py- Comprehensive test suite (11 tests)tests/conftest.py- Test fixtures and httpx client cleanuptests/test_examples.py- Environment variable setupREADME.md- Added to provider listdocs/index.md- Added to provider listdocs/models/overview.md- Added to OpenAI-compatible providersdocs/models/openai.md- Full documentation section with examplesdocs/api/providers.md- API referenceImplementation Details
Multi-Profile Pattern
The provider implements profile matching based on model name prefixes, similar to Fireworks:
This approach matches SambaNova's actual API naming convention (direct model names without provider prefixes).
Usage Example
Checklist
DashScopeProviderand support audio input for Qwen Omni #3596, Fireworks, Together)Fixes #3669
Note: This implementation was verified against SambaNova's actual API documentation and model catalog to ensure correct model naming conventions and profile matching.