- Notifications
You must be signed in to change notification settings - Fork 1.5k
Add CerebrasModel #3486
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
Add CerebrasModel #3486
Conversation
| @sebastiand-cerebras Hey Seb, Cerebras is already documented at https://ai.pydantic.dev/models/openai/#cerebras as it uses the In #3089, we're implementing a new Would it be an option to do same thing for Cerebras, implementing support for any Cerebras-specific additions to the chat completions API? PS. We have a private Slack channel with Cerebras; happy to discuss this more there as well |
| Thank you so much for your feedback! I did add these:
|
d0d58e4 to 92d59c7 Compare
DouweM left a comment
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.
Thanks @sebastiand-cerebras, just one tiny thing and I'll merge!
3f9cd8c to 4bb749c Compare - Update docs/models/cerebras.md: use pip/uv-add format, link to Cerebras docs - Fix httpx.AsyncClient typo in cerebras.md, groq.md, mistral.md - Add docs/api/models/cerebras.md and update mkdocs.yml - Remove Cerebras section from openai.md, move to main list in overview.md - Add str | to CerebrasModelName for arbitrary model names - Add CerebrasModelSettings with cerebras_disable_reasoning field - Add zai_model_profile, restore unsupported_model_settings and json_schema_transformer - Pass lowercase model name to profile functions - Add tests/providers/test_cerebras.py with full coverage - Remove type ignore in models/__init__.py
Documentation changes: - Revert openrouter example to moonshotai in docs/models/openai.md - Remove OpenRouter section from docs/models/openai.md (now has its own model class) - Restore alphabetical ordering in docs/models/overview.md - Restore ModelAPIError references in docs/models/overview.md - Restore alphabetical ordering and openrouter.md in mkdocs.yml Code changes: - Remove openrouter from OpenAI-compatible providers list in models/__init__.py - Move OpenAIChatModel import into try block in models/cerebras.py - Rename _KnownCerebrasModelName to LatestCerebrasModelNames - Implement cerebras_disable_reasoning setting via extra_body transformation - Move zai_model_profile to profiles/zai.py (returns None, properties handled at provider level) - Add X-Cerebras-3rd-Party-Integration header to all Cerebras API requests Tests: - Add tests/models/test_cerebras.py with unit and integration tests for disable_reasoning
zai_model_profile returns None, so supports_json_object_output and supports_json_schema_output default to False from OpenAIModelProfile base.
… fix alphabetical order
| @sebastiand-cerebras Please have a look at the linter failure; we'll likely need a |
4bb749c to 82827e7 Compare
Thank you for reviewing this.