-
Notifications
You must be signed in to change notification settings - Fork 892
add custom AI providers in config #7771
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c5b975d to
4784f31
Compare
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.
Pull request overview
This PR adds support for configuring multiple custom OpenAI-compatible AI providers through the settings UI and configuration files. Users can now define custom providers (like Groq, Together AI, DeepSeek, etc.) with distinct names instead of being limited to a single open_ai_compatible provider.
Changes:
- Added
custom_providersfield to AI configuration as a dictionary mapping provider names to OpenAI-compatible configs - Implemented deep merge utility with selective replacement for managing provider configurations
- Extended frontend UI to allow adding, editing, and removing custom providers
- Updated documentation with examples for popular OpenAI-compatible providers
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
marimo/_utils/deep_merge.py |
New deep merge utility with replace_paths feature for selective replacement during config merging |
marimo/_config/config.py |
Added custom_providers field to AiConfig and configured it as a replace path in merge_config |
marimo/_config/secrets.py |
Extended secrets masking to handle api_keys in custom_providers |
marimo/_server/ai/config.py |
Added for_custom_provider method to handle provider configs by name and updated for_model to check custom providers |
frontend/src/core/ai/ids/ids.ts |
Extended ProviderId type to accept both known providers and custom strings while maintaining autocomplete |
frontend/src/core/config/config-schema.ts |
Added custom_providers schema field with default empty object |
frontend/src/components/app-config/ai-config.tsx |
Added CustomProvidersConfig component with UI for adding, editing, and removing custom providers |
frontend/src/components/app-config/user-config-form.tsx |
Updated getDirtyValues to handle undefined values when providers are deleted |
tests/_utils/test_deep_merge.py |
Comprehensive tests for deep merge functionality including replace_paths behavior |
tests/_config/test_config.py |
Tests for custom_providers replacement behavior in config merging |
tests/_config/test_secrets_config.py |
Tests for masking and removing secrets in custom_providers |
tests/_server/templates/snapshots/*.txt |
Updated snapshots to include custom_providers in config |
docs/guides/configuration/llm_providers.md |
Updated documentation with custom providers section and provider-specific examples |
packages/openapi/api.yaml |
Added custom_providers to AiConfig schema |
packages/openapi/src/api.ts |
TypeScript types updated for custom_providers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
akshayka
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.
This is really nice! One clarification may be needed in the docs (see my comment), otherwise looks good to me
| </video> | ||
| </div> | ||
|
|
||
| Once added, use your custom provider with the prefix you chose: |
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.
Should users specify their models directly in the marimo.toml file, or in the settings UI? As written it seems like the recommendation is the marimo.toml since that is what follows this sentence
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! fixed
8be0a49 to
e18290c
Compare
📝 Summary
Fixes #7243.
🔍 Description of Changes
📋 Checklist