Skip to content

Conversation

@Light2Dark
Copy link
Contributor

@Light2Dark Light2Dark commented Jan 10, 2026

📝 Summary

Fixes #7243.

image image image

🔍 Description of Changes

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.
@vercel
Copy link

vercel bot commented Jan 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 15, 2026 4:59pm

Review with Vercel Agent

@Light2Dark Light2Dark changed the title add custom providers Jan 10, 2026
@Light2Dark Light2Dark changed the title add custom providers in config Jan 10, 2026
@github-actions github-actions bot added documentation Improvements or additions to documentation bash-focus Area to focus on during release bug bash labels Jan 10, 2026
@Light2Dark Light2Dark added the enhancement New feature or request label Jan 10, 2026
@Light2Dark Light2Dark force-pushed the sham/add-custom-providers branch from c5b975d to 4784f31 Compare January 13, 2026 07:16
@Light2Dark Light2Dark marked this pull request as ready for review January 13, 2026 07:18
@mscolnick mscolnick requested a review from Copilot January 13, 2026 14:57
Copy link
Contributor

Copilot AI left a 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_providers field 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.

Copy link
Contributor

@akshayka akshayka left a 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:
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! fixed

mscolnick
mscolnick previously approved these changes Jan 15, 2026
@Light2Dark Light2Dark merged commit 093b8a7 into main Jan 15, 2026
59 of 123 checks passed
@Light2Dark Light2Dark deleted the sham/add-custom-providers branch January 15, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash-focus Area to focus on during release bug bash documentation Improvements or additions to documentation enhancement New feature or request

4 participants