Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

improvement: multiple models for different roles (#6018)

Myles Scolnickf3fe768df9a9
diff --git a/frontend/src/components/app-config/ai-config.tsx b/frontend/src/components/app-config/ai-config.tsx
index 744b565a7f..ade4b15976 100644
--- a/frontend/src/components/app-config/ai-config.tsx
+++ b/frontend/src/components/app-config/ai-config.tsx
@@ -15,7 +15,7 @@ import { Kbd } from "@/components/ui/kbd";
import { NativeSelect } from "@/components/ui/native-select";
import { Textarea } from "@/components/ui/textarea";
import { CopilotConfig } from "@/core/codemirror/copilot/copilot-config";
-import type { UserConfig } from "@/core/config/config-schema";
+import { DEFAULT_AI_MODEL, type UserConfig } from "@/core/config/config-schema";
import { isWasm } from "@/core/wasm/utils";
import {
AiProviderIcon,
@@ -181,6 +181,7 @@ interface ModelSelectorProps {
testId: string;
description?: React.ReactNode;
disabled?: boolean;
+ label: string;
}
export const ModelSelector: React.FC<ModelSelectorProps> = ({
@@ -191,6 +192,7 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
testId,
description,
disabled = false,
+ label,
}) => {
const modelInputId = useId();
@@ -202,7 +204,7 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
render={({ field }) => (
<div className="flex flex-col space-y-1">
<FormItem className={formItemClasses}>
- <FormLabel>Model</FormLabel>
+ <FormLabel>{label}</FormLabel>
<FormControl>
<Input
list={modelInputId}
@@ -335,25 +337,19 @@ const renderCopilotProvider = (
settings.
</p>
<ModelSelector
+ label="Autocomplete Model"
form={form}
config={config}
- name="completion.model"
- placeholder="Qwen2.5-Coder-7B"
+ name="ai.models.autocomplete_model"
+ placeholder="ollama/qwen2.5-coder:1.5b"
testId="custom-model-input"
- />
- <BaseUrl
- form={form}
- config={config}
- name="completion.base_url"
- placeholder="http://localhost:11434/v1"
- testId="custom-base-url-input"
- />
- <ApiKey
- form={form}
- config={config}
- name="completion.api_key"
- placeholder="key"
- testId="custom-api-key-input"
+ description={
+ <>
+ Model to use for code completion when using a custom provider.
+ Models should include the provider name and model name separated
+ by a slash.
+ </>
+ }
/>
</>
);
@@ -661,18 +657,20 @@ export const AiAssistConfig: React.FC<AiConfigProps> = ({ form, config }) => {
</p>
<ModelSelector
+ label="Chat Model"
form={form}
config={config}
- name="ai.open_ai.model"
- placeholder="gpt-4-turbo"
- testId="ai-model-input"
+ name="ai.models.chat_model"
+ placeholder={DEFAULT_AI_MODEL}
+ testId="ai-chat-model-input"
disabled={isWasmRuntime}
description={
<>
<p>
- Models should include the provider name and model name separated
- by a slash. For example, "anthropic/claude-3-7-sonnet-latest" or
- "google/gemini-2.5-flash-preview-05-20".
+ Model to use for chat conversations in the Chat panel. Models
+ should include the provider name and model name separated by a
+ slash. For example, "anthropic/claude-3-5-sonnet-latest" or
+ "google/gemini-2.0-flash-exp".
</p>
<p className="pt-1">
Depending on the provider, we will use the respective API key and
@@ -682,6 +680,29 @@ export const AiAssistConfig: React.FC<AiConfigProps> = ({ form, config }) => {
}
/>
+ <ModelSelector
+ label="Edit Model"
+ form={form}
+ config={config}
+ name="ai.models.edit_model"
+ placeholder={DEFAULT_AI_MODEL}
+ testId="ai-edit-model-input"
+ disabled={isWasmRuntime}
+ description={
+ <>
+ <p>
+ Model to use for code editing with the{" "}
+ <Kbd className="inline">Generate with AI</Kbd> button. Models
+ should include the provider name and model name separated by a
+ slash.
+ </p>
+ <p className="pt-1">
+ You can use a faster, cheaper model for edits if desired.
+ </p>
+ </>
+ }
+ />
+
<FormField
control={form.control}
name="ai.rules"
diff --git a/frontend/src/components/chat/chat-panel.tsx b/frontend/src/components/chat/chat-panel.tsx
index 190fa27d46..5fea9c3114 100644
--- a/frontend/src/components/chat/chat-panel.tsx
+++ b/frontend/src/components/chat/chat-panel.tsx
@@ -44,7 +44,7 @@ import {
} from "@/core/ai/state";
import { getCodes } from "@/core/codemirror/copilot/getCodes";
import { aiAtom, aiEnabledAtom, userConfigAtom } from "@/core/config/config";
-import type { UserConfig } from "@/core/config/config-schema";
+import { DEFAULT_AI_MODEL, type UserConfig } from "@/core/config/config-schema";
import { FeatureFlagged } from "@/core/config/feature-flag";
import { useRequestClient } from "@/core/network/requests";
import { useRuntimeManager } from "@/core/runtime/config";
@@ -242,12 +242,14 @@ interface ChatInputFooterProps {
onStop: () => void;
}
+const DEFAULT_MODE = "manual";
+
const ChatInputFooter: React.FC<ChatInputFooterProps> = memo(
({ input, onSendClick, isLoading, onStop }) => {
const ai = useAtomValue(aiAtom);
const [userConfig, setUserConfig] = useAtom(userConfigAtom);
- const currentMode = ai?.mode || "manual";
- const currentModel = ai?.open_ai?.model || "o4-mini";
+ const currentMode = ai?.mode || DEFAULT_MODE;
+ const currentModel = ai?.models?.chat_model || DEFAULT_AI_MODEL;
const { saveUserConfig } = useRequestClient();
const modeOptions = [
@@ -279,9 +281,11 @@ const ChatInputFooter: React.FC<ChatInputFooterProps> = memo(
...userConfig,
ai: {
...userConfig.ai,
- open_ai: {
- ...userConfig.ai?.open_ai,
- model: newModel,
+ models: {
+ custom_models: [],
+ displayed_models: [],
+ ...userConfig.ai?.models,
+ chat_model: newModel,
},
},
};
diff --git a/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx b/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx
index 6bad8609c4..24976fe3b1 100644
--- a/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx
+++ b/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx
@@ -5,12 +5,14 @@ import { SparklesIcon } from "lucide-react";
import React from "react";
import { useOpenSettingsToTab } from "@/components/app-config/state";
import { aiAtom, aiEnabledAtom } from "@/core/config/config";
+import { DEFAULT_AI_MODEL } from "@/core/config/config-schema";
import { FooterItem } from "../footer-item";
export const AIStatusIcon: React.FC = () => {
const ai = useAtomValue(aiAtom);
const aiEnabled = useAtomValue(aiEnabledAtom);
- const model = ai?.open_ai?.model || "gpt-4-turbo";
+ const chatModel = ai?.models?.chat_model || DEFAULT_AI_MODEL;
+ const editModel = ai?.models?.edit_model || chatModel;
const { handleClick } = useOpenSettingsToTab();
if (!aiEnabled) {
@@ -30,7 +32,9 @@ export const AIStatusIcon: React.FC = () => {
<FooterItem
tooltip={
<>
- <b>Assist model:</b> {model}
+ <b>Chat model:</b> {chatModel}
+ <br />
+ <b>Edit model:</b> {editModel}
</>
}
onClick={() => handleClick("ai")}
diff --git a/frontend/src/core/config/__tests__/config-schema.test.ts b/frontend/src/core/config/__tests__/config-schema.test.ts
index 718e45f189..43e33e727e 100644
--- a/frontend/src/core/config/__tests__/config-schema.test.ts
+++ b/frontend/src/core/config/__tests__/config-schema.test.ts
@@ -45,6 +45,10 @@ test("default UserConfig - empty", () => {
{
"ai": {
"mode": "manual",
+ "models": {
+ "custom_models": [],
+ "displayed_models": [],
+ },
"rules": "",
},
"completion": {
@@ -105,6 +109,10 @@ test("default UserConfig - one level", () => {
{
"ai": {
"mode": "manual",
+ "models": {
+ "custom_models": [],
+ "displayed_models": [],
+ },
"rules": "",
},
"completion": {
diff --git a/frontend/src/core/config/config-schema.ts b/frontend/src/core/config/config-schema.ts
index f18e2b545c..34bd22070d 100644
--- a/frontend/src/core/config/config-schema.ts
+++ b/frontend/src/core/config/config-schema.ts
@@ -37,6 +37,8 @@ const VALID_SQL_OUTPUT_FORMATS = [
] as const;
export type SqlOutputType = (typeof VALID_SQL_OUTPUT_FORMATS)[number];
+export const DEFAULT_AI_MODEL = "openai/gpt-4o";
+
/**
* Export types for auto download
*/
@@ -142,13 +144,7 @@ export const UserConfigSchema = z
.object({
rules: z.string().default(""),
mode: z.enum(["manual", "ask"]).default("manual"),
- // TODO: the model currently exists on the open_ai object, but we should
- // move it to the top level.
- open_ai: AiConfigSchema.extend({
- model: z.string().optional(),
- })
- .passthrough()
- .optional(),
+ open_ai: AiConfigSchema.optional(),
anthropic: AiConfigSchema.optional(),
google: AiConfigSchema.optional(),
ollama: AiConfigSchema.optional(),
@@ -162,6 +158,18 @@ export const UserConfigSchema = z
aws_secret_access_key: z.string().optional(),
})
.optional(),
+ models: z
+ .object({
+ chat_model: z.string().nullish(),
+ edit_model: z.string().nullish(),
+ autocomplete_model: z.string().nullish(),
+ displayed_models: z.array(z.string()).default([]),
+ custom_models: z.array(z.string()).default([]),
+ })
+ .default({
+ displayed_models: [],
+ custom_models: [],
+ }),
})
.passthrough()
.default({}),
@@ -198,6 +206,7 @@ export const UserConfigSchema = z
rules: "",
mode: "manual",
open_ai: {},
+ models: {},
},
});
export type UserConfig = MarimoConfig;
diff --git a/frontend/src/core/config/config.ts b/frontend/src/core/config/config.ts
index 8504f5408d..e1c38bbc23 100644
--- a/frontend/src/core/config/config.ts
+++ b/frontend/src/core/config/config.ts
@@ -79,6 +79,9 @@ export function isAiEnabled(config: UserConfig) {
Boolean(config.ai?.open_ai?.api_key) ||
Boolean(config.ai?.anthropic?.api_key) ||
Boolean(config.ai?.google?.api_key) ||
+ Boolean(config.ai?.azure?.api_key) ||
+ Boolean(config.ai?.ollama?.api_key) ||
+ Boolean(config.ai?.open_ai_compatible?.api_key) ||
Boolean(config.ai?.bedrock?.profile_name)
);
}
diff --git a/marimo/_config/config.py b/marimo/_config/config.py
index 571732a64f..61ef825366 100644
--- a/marimo/_config/config.py
+++ b/marimo/_config/config.py
@@ -40,9 +40,6 @@ class CompletionConfig(TypedDict):
until the completion hotkey is entered
- `copilot`: one of `"github"`, `"codeium"`, or `"custom"`
- `codeium_api_key`: the Codeium API key
- - `api_key`: the API key for the LLM provider, when `copilot` is `"custom"`
- - `model`: the model to use, when `copilot` is `"custom"`
- - `base_url`: the base URL for the API, when `copilot` is `"custom"`
"""
activate_on_typing: bool
@@ -51,7 +48,7 @@ class CompletionConfig(TypedDict):
# Codeium
codeium_api_key: NotRequired[Optional[str]]
- # Custom
+ # @deprecated: use `ai.models.autocomplete_model` instead
api_key: NotRequired[Optional[str]]
model: NotRequired[Optional[str]]
base_url: NotRequired[Optional[str]]
@@ -233,6 +230,28 @@ class PackageManagementConfig(TypedDict):
CopilotMode = Literal["ask", "manual"]
+@mddoc
+@dataclass
+class AiModelConfig(TypedDict):
+ """Configuration options for an AI model.
+
+ **Keys.**
+
+ - `chat_model`: the model to use for chat completions
+ - `edit_model`: the model to use for edit completions
+ - `autocomplete_model`: the model to use for code completion/autocomplete
+ - `displayed_models`: a list of models to display in the UI
+ - `custom_models`: a list of custom models to use that are not from the default list
+ """
+
+ chat_model: NotRequired[str]
+ edit_model: NotRequired[str]
+ autocomplete_model: NotRequired[str]
+
+ displayed_models: list[str]
+ custom_models: list[str]
+
+
@dataclass
class AiConfig(TypedDict, total=False):
"""Configuration options for AI.
@@ -242,15 +261,20 @@ class AiConfig(TypedDict, total=False):
- `rules`: custom rules to include in all AI completion prompts
- `max_tokens`: the maximum number of tokens to use in AI completions
- `mode`: the mode to use for AI completions. Can be one of: `"ask"` or `"manual"`
+ - `models`: the models to use for AI completions
- `open_ai`: the OpenAI config
- `anthropic`: the Anthropic config
- `google`: the Google AI config
- `bedrock`: the Bedrock config
+ - `azure`: the Azure config
+ - `ollama`: the Ollama config
+ - `open_ai_compatible`: the OpenAI-compatible config
"""
rules: NotRequired[str]
max_tokens: NotRequired[int]
mode: NotRequired[CopilotMode]
+ models: AiModelConfig
# providers
open_ai: OpenAiConfig
@@ -269,8 +293,6 @@ class OpenAiConfig(TypedDict, total=False):
**Keys.**
- `api_key`: the OpenAI API key
- - `model`: the model to use.
- if model starts with `claude-` we use the AnthropicConfig
- `base_url`: the base URL for the API
- `ssl_verify` : Boolean argument for httpx passed to open ai client. httpx defaults to true, but some use cases to let users override to False in some testing scenarios
- `ca_bundle_path`: custom ca bundle to be used for verifying SSL certificates. Used to create custom SSL context for httpx client
@@ -278,12 +300,14 @@ class OpenAiConfig(TypedDict, total=False):
"""
api_key: str
- model: NotRequired[str]
base_url: NotRequired[str]
ssl_verify: NotRequired[bool]
ca_bundle_path: NotRequired[str]
client_pem: NotRequired[str]
+ # @deprecated: use `ai.models.chat_model` instead
+ model: NotRequired[str]
+
@dataclass
class AnthropicConfig(TypedDict, total=False):
@@ -582,6 +606,12 @@ DEFAULT_CONFIG: MarimoConfig = {
"enable_pyflakes": False,
}
},
+ "ai": {
+ "models": {
+ "displayed_models": [],
+ "custom_models": [],
+ }
+ },
"snippets": {
"custom_paths": [],
"include_default_snippets": True,
@@ -638,4 +668,36 @@ def merge_config(
):
merged["runtime"]["auto_reload"] = "lazy"
+ # If missing ai.models.chat_model or ai.models.edit_model, use ai.open_ai.model
+ openai_model = merged.get("ai", {}).get("open_ai", {}).get("model")
+ chat_model = merged.get("ai", {}).get("models", {}).get("chat_model")
+ edit_model = merged.get("ai", {}).get("models", {}).get("edit_model")
+ if not chat_model and not edit_model and openai_model:
+ merged_ai_config = cast(dict[Any, Any], merged.get("ai", {}))
+ models_config = {
+ "models": {
+ "chat_model": chat_model or openai_model,
+ "edit_model": edit_model or openai_model,
+ }
+ }
+ merged["ai"] = cast(
+ AiConfig, deep_merge(merged_ai_config, models_config)
+ )
+
+ # Migrate completion.model to ai.models.autocomplete_model
+ completion_model = merged.get("completion", {}).get("model")
+ autocomplete_model = (
+ merged.get("ai", {}).get("models", {}).get("autocomplete_model")
+ )
+ if completion_model and not autocomplete_model:
+ merged_ai_config = cast(dict[Any, Any], merged.get("ai", {}))
+ models_config = {
+ "models": {
+ "autocomplete_model": completion_model,
+ }
+ }
+ merged["ai"] = cast(
+ AiConfig, deep_merge(merged_ai_config, models_config)
+ )
+
return merged
diff --git a/marimo/_server/ai/config.py b/marimo/_server/ai/config.py
index 93f5c3a48b..5311f459b2 100644
--- a/marimo/_server/ai/config.py
+++ b/marimo/_server/ai/config.py
@@ -5,6 +5,7 @@ from dataclasses import dataclass, field
from typing import (
Any,
Optional,
+ Union,
cast,
)
@@ -12,17 +13,15 @@ from starlette.exceptions import HTTPException
from marimo._config.config import (
AiConfig,
- CompletionConfig,
CopilotMode,
MarimoConfig,
+ PartialMarimoConfig,
)
+from marimo._server.ai.constants import DEFAULT_MAX_TOKENS, DEFAULT_MODEL
from marimo._server.ai.ids import AiModelId
from marimo._server.ai.tools import Tool, get_tool_manager
from marimo._server.api.status import HTTPStatus
-DEFAULT_MAX_TOKENS = 4096
-DEFAULT_MODEL = "gpt-4o-mini"
-
@dataclass
class AnyProviderConfig:
@@ -131,15 +130,6 @@ class AnyProviderConfig:
tools=_get_tools(config.get("mode", "manual")),
)
- @classmethod
- def for_completion(cls, config: CompletionConfig) -> AnyProviderConfig:
- key = _get_key(config, "AI completion")
- return cls(
- base_url=_get_base_url(config),
- api_key=key,
- tools=[], # Inline completion never uses tools
- )
-
@classmethod
def for_model(cls, model: str, config: AiConfig) -> AnyProviderConfig:
model_id = AiModelId.from_model(model)
@@ -185,8 +175,33 @@ def _get_ai_config(config: AiConfig, key: str, name: str) -> dict[str, Any]:
return cast(dict[str, Any], config.get(key, {}))
-def get_model(config: AiConfig) -> str:
- return config.get("open_ai", {}).get("model") or DEFAULT_MODEL
+def get_chat_model(config: AiConfig) -> str:
+ """Get the chat model from the config."""
+ return (
+ # Current config
+ config.get("models", {}).get("chat_model")
+ # Legacy config
+ or config.get("open_ai", {}).get("model")
+ or DEFAULT_MODEL
+ )
+
+
+def get_edit_model(config: AiConfig) -> str:
+ """Get the edit model from the config."""
+ return config.get("models", {}).get("edit_model") or get_chat_model(config)
+
+
+def get_autocomplete_model(
+ config: Union[MarimoConfig, PartialMarimoConfig],
+) -> str:
+ """Get the autocomplete model from the config."""
+ return (
+ # Current config
+ config.get("ai", {}).get("models", {}).get("autocomplete_model")
+ # Legacy config
+ or config.get("completion", {}).get("model")
+ or DEFAULT_MODEL
+ )
def get_max_tokens(config: MarimoConfig) -> int:
@@ -210,6 +225,8 @@ def _get_key(
detail="Invalid config",
)
+ config = cast(dict[str, Any], config)
+
if name == "Bedrock":
if "profile_name" in config:
profile_name = config.get("profile_name", "")
diff --git a/marimo/_server/ai/constants.py b/marimo/_server/ai/constants.py
new file mode 100644
index 0000000000..ae4ac373ac
--- /dev/null
+++ b/marimo/_server/ai/constants.py
@@ -0,0 +1,2 @@
+DEFAULT_MAX_TOKENS = 4096
+DEFAULT_MODEL = "openai/gpt-4o"
diff --git a/marimo/_server/api/endpoints/ai.py b/marimo/_server/api/endpoints/ai.py
index df66f70acb..34066e4e27 100644
--- a/marimo/_server/api/endpoints/ai.py
+++ b/marimo/_server/api/endpoints/ai.py
@@ -16,10 +16,11 @@ from marimo import _loggers
from marimo._ai._types import ChatMessage
from marimo._config.config import AiConfig, MarimoConfig
from marimo._server.ai.config import (
- DEFAULT_MODEL,
AnyProviderConfig,
+ get_autocomplete_model,
+ get_chat_model,
+ get_edit_model,
get_max_tokens,
- get_model,
)
from marimo._server.ai.prompts import (
FILL_ME_TAG,
@@ -112,7 +113,7 @@ async def ai_completion(
)
prompt = body.prompt
- model = get_model(ai_config)
+ model = get_edit_model(ai_config)
provider = get_completion_provider(
AnyProviderConfig.for_model(model, ai_config),
model=model,
@@ -168,7 +169,7 @@ async def ai_chat(
max_tokens = get_max_tokens(config)
- model = body.model or get_model(ai_config)
+ model = body.model or get_chat_model(ai_config)
provider = get_completion_provider(
AnyProviderConfig.for_model(model, ai_config),
model=model,
@@ -223,15 +224,15 @@ async def ai_inline_completion(
# of 4096, since it is smaller/faster for inline completions
INLINE_COMPLETION_MAX_TOKENS = 1024
- try:
- model = config["completion"]["model"] or DEFAULT_MODEL
- except Exception:
- model = DEFAULT_MODEL
+ ai_config = get_ai_config(config)
- provider = get_completion_provider(
- AnyProviderConfig.for_completion(config["completion"]),
- model=model,
- )
+ model = get_autocomplete_model(config)
+ provider_config = AnyProviderConfig.for_model(model, ai_config)
+ # Inline completion never uses tools
+ if provider_config.tools:
+ provider_config.tools.clear()
+
+ provider = get_completion_provider(provider_config, model=model)
response = provider.stream_completion(
messages=messages,
system_prompt=system_prompt,
diff --git a/packages/openapi/api.yaml b/packages/openapi/api.yaml
index 48ea2e41a2..dfb2d63b58 100644
--- a/packages/openapi/api.yaml
+++ b/packages/openapi/api.yaml
@@ -8,7 +8,7 @@ components:
nullable: true
type: boolean
required:
- - package
+ - package
type: object
AiCompletionContext:
properties:
@@ -19,12 +19,12 @@ components:
variables:
items:
oneOf:
- - $ref: '#/components/schemas/VariableContext'
- - type: string
+ - $ref: '#/components/schemas/VariableContext'
+ - type: string
type: array
required:
- - schema
- - variables
+ - schema
+ - variables
type: object
AiCompletionRequest:
properties:
@@ -37,9 +37,9 @@ components:
type: string
language:
enum:
- - python
- - markdown
- - sql
+ - python
+ - markdown
+ - sql
type: string
prompt:
type: string
@@ -47,10 +47,10 @@ components:
nullable: true
type: string
required:
- - prompt
- - includeOtherCode
- - code
- - language
+ - prompt
+ - includeOtherCode
+ - code
+ - language
type: object
AiConfig:
properties:
@@ -66,9 +66,29 @@ components:
type: integer
mode:
enum:
- - ask
- - manual
+ - ask
+ - manual
type: string
+ models:
+ properties:
+ autocomplete_model:
+ type: string
+ chat_model:
+ type: string
+ custom_models:
+ items:
+ type: string
+ type: array
+ edit_model:
+ type: string
+ displayed_models:
+ items:
+ type: string
+ type: array
+ required:
+ - displayed_models
+ - custom_models
+ type: object
ollama:
$ref: '#/components/schemas/OpenAiConfig'
open_ai:
@@ -82,18 +102,18 @@ components:
properties:
language:
enum:
- - python
- - markdown
- - sql
+ - python
+ - markdown
+ - sql
type: string
prefix:
type: string
suffix:
type: string
required:
- - prefix
- - suffix
- - language
+ - prefix
+ - suffix
+ - language
type: object
Alert:
properties:
@@ -101,19 +121,19 @@ components:
type: string
name:
enum:
- - alert
+ - alert
type: string
title:
type: string
variant:
enum:
- - danger
+ - danger
nullable: true
type: string
required:
- - title
- - description
- - name
+ - title
+ - description
+ - name
type: object
AnthropicConfig:
properties:
@@ -124,33 +144,33 @@ components:
properties:
action:
enum:
- - restart
+ - restart
nullable: true
type: string
description:
type: string
name:
enum:
- - banner
+ - banner
type: string
title:
type: string
variant:
enum:
- - danger
+ - danger
nullable: true
type: string
required:
- - title
- - description
- - name
+ - title
+ - description
+ - name
type: object
BaseResponse:
properties:
success:
type: boolean
required:
- - success
+ - success
type: object
BedrockConfig:
properties:
@@ -165,13 +185,13 @@ components:
type: object
CellChannel:
enum:
- - stdout
- - stderr
- - stdin
- - pdb
- - output
- - marimo-error
- - media
+ - stdout
+ - stderr
+ - stdin
+ - pdb
+ - output
+ - marimo-error
+ - media
type: string
CellConfig:
properties:
@@ -183,8 +203,8 @@ components:
hide_code:
type: boolean
required:
- - disabled
- - hide_code
+ - disabled
+ - hide_code
type: object
CellOp:
properties:
@@ -193,13 +213,13 @@ components:
console:
nullable: true
oneOf:
- - $ref: '#/components/schemas/CellOutput'
- - items:
- $ref: '#/components/schemas/CellOutput'
- type: array
+ - $ref: '#/components/schemas/CellOutput'
+ - items:
+ $ref: '#/components/schemas/CellOutput'
+ type: array
name:
enum:
- - cell-op
+ - cell-op
type: string
output:
$ref: '#/components/schemas/CellOutput'
@@ -219,9 +239,9 @@ components:
timestamp:
type: number
required:
- - cell_id
- - timestamp
- - name
+ - cell_id
+ - timestamp
+ - name
type: object
CellOutput:
properties:
@@ -229,21 +249,21 @@ components:
$ref: '#/components/schemas/CellChannel'
data:
oneOf:
- - type: string
- - items:
- $ref: '#/components/schemas/Error'
- type: array
- - additionalProperties: {}
- type: object
+ - type: string
+ - items:
+ $ref: '#/components/schemas/Error'
+ type: array
+ - additionalProperties: {}
+ type: object
mimetype:
$ref: '#/components/schemas/MimeType'
timestamp:
type: number
required:
- - channel
- - mimetype
- - data
- - timestamp
+ - channel
+ - mimetype
+ - data
+ - timestamp
type: object
ChatRequest:
properties:
@@ -265,8 +285,8 @@ components:
url:
type: string
required:
- - url
- - name
+ - url
+ - name
type: object
nullable: true
type: array
@@ -276,90 +296,90 @@ components:
parts:
items:
oneOf:
- - properties:
- text:
- type: string
- type:
- enum:
+ - properties:
+ text:
+ type: string
+ type:
+ enum:
+ - text
+ type: string
+ required:
+ - type
- text
- type: string
- required:
- - type
- - text
- type: object
- - properties:
- details:
- items:
+ type: object
+ - properties:
+ details:
+ items:
+ properties:
+ signature:
+ nullable: true
+ type: string
+ text:
+ type: string
+ type:
+ enum:
+ - text
+ type: string
+ required:
+ - type
+ - text
+ type: object
+ type: array
+ reasoning:
+ type: string
+ type:
+ enum:
+ - reasoning
+ type: string
+ required:
+ - type
+ - reasoning
+ - details
+ type: object
+ - properties:
+ toolInvocation:
properties:
- signature:
- nullable: true
+ args:
+ additionalProperties: {}
+ type: object
+ result: {}
+ state:
+ enum:
+ - result
type: string
- text:
+ step:
+ type: integer
+ toolCallId:
type: string
- type:
- enum:
- - text
+ toolName:
type: string
required:
- - type
- - text
- type: object
- type: array
- reasoning:
- type: string
- type:
- enum:
- - reasoning
- type: string
- required:
- - type
- - reasoning
- - details
- type: object
- - properties:
- toolInvocation:
- properties:
- args:
- additionalProperties: {}
- type: object
- result: {}
- state:
- enum:
+ - state
- result
- type: string
- step:
- type: integer
- toolCallId:
- type: string
- toolName:
- type: string
- required:
- - state
- - result
- - toolCallId
- - toolName
- - step
- - args
- type: object
- type:
- enum:
- - tool-invocation
- type: string
- required:
- - type
- - toolInvocation
- type: object
+ - toolCallId
+ - toolName
+ - step
+ - args
+ type: object
+ type:
+ enum:
+ - tool-invocation
+ type: string
+ required:
+ - type
+ - toolInvocation
+ type: object
nullable: true
type: array
role:
enum:
- - user
- - assistant
- - system
+ - user
+ - assistant
+ - system
type: string
required:
- - role
- - content
+ - role
+ - content
type: object
type: array
model:
@@ -368,14 +388,14 @@ components:
variables:
items:
oneOf:
- - $ref: '#/components/schemas/VariableContext'
- - type: string
+ - $ref: '#/components/schemas/VariableContext'
+ - type: string
nullable: true
type: array
required:
- - context
- - includeOtherCode
- - messages
+ - context
+ - includeOtherCode
+ - messages
type: object
CodeCompletionRequest:
properties:
@@ -386,9 +406,9 @@ components:
id:
type: string
required:
- - id
- - document
- - cellId
+ - id
+ - document
+ - cellId
type: object
ColumnStats:
properties:
@@ -439,10 +459,10 @@ components:
properties:
name:
enum:
- - completed-run
+ - completed-run
type: string
required:
- - name
+ - name
type: object
CompletionResult:
properties:
@@ -450,7 +470,7 @@ components:
type: string
name:
enum:
- - completion-result
+ - completion-result
type: string
options:
items:
@@ -463,17 +483,17 @@ components:
type:
type: string
required:
- - name
- - type
+ - name
+ - type
type: object
type: array
prefix_length:
type: integer
required:
- - completion_id
- - prefix_length
- - options
- - name
+ - completion_id
+ - prefix_length
+ - options
+ - name
type: object
CopyNotebookRequest:
properties:
@@ -482,8 +502,8 @@ components:
source:
type: string
required:
- - source
- - destination
+ - source
+ - destination
type: object
CreateSecretRequest:
properties:
@@ -493,36 +513,36 @@ components:
type: string
provider:
enum:
- - env
- - dotenv
+ - env
+ - dotenv
type: string
value:
type: string
required:
- - key
- - value
- - provider
- - name
+ - key
+ - value
+ - provider
+ - name
type: object
CycleError:
properties:
edges_with_vars:
items:
prefixItems:
- - type: string
- - items:
- type: string
- type: array
- - type: string
+ - type: string
+ - items:
+ type: string
+ type: array
+ - type: string
type: array
type: array
type:
enum:
- - cycle
+ - cycle
type: string
required:
- - edges_with_vars
- - type
+ - edges_with_vars
+ - type
type: object
DataColumnPreview:
properties:
@@ -544,7 +564,7 @@ components:
type: array
name:
enum:
- - data-column-preview
+ - data-column-preview
type: string
stats:
$ref: '#/components/schemas/ColumnStats'
@@ -552,9 +572,9 @@ components:
table_name:
type: string
required:
- - table_name
- - column_name
- - name
+ - table_name
+ - column_name
+ - name
type: object
DataSourceConnection:
properties:
@@ -578,14 +598,14 @@ components:
$ref: '#/components/schemas/DataTable'
type: array
required:
- - name
- - tables
+ - name
+ - tables
type: object
type: array
required:
- - name
- - dialect
- - schemas
+ - name
+ - dialect
+ - schemas
type: object
type: array
default_database:
@@ -603,11 +623,11 @@ components:
source:
type: string
required:
- - source
- - dialect
- - name
- - display_name
- - databases
+ - source
+ - dialect
+ - name
+ - display_name
+ - databases
type: object
DataSourceConnections:
properties:
@@ -617,11 +637,11 @@ components:
type: array
name:
enum:
- - data-source-connections
+ - data-source-connections
type: string
required:
- - connections
- - name
+ - connections
+ - name
type: object
DataTable:
properties:
@@ -654,25 +674,25 @@ components:
type: string
source_type:
enum:
- - local
- - duckdb
- - connection
- - catalog
+ - local
+ - duckdb
+ - connection
+ - catalog
type: string
type:
enum:
- - table
- - view
+ - table
+ - view
type: string
variable_name:
nullable: true
type: string
required:
- - source_type
- - source
- - name
- - columns
- - type
+ - source_type
+ - source
+ - name
+ - columns
+ - type
type: object
DataTableColumn:
properties:
@@ -686,21 +706,21 @@ components:
type:
$ref: '#/components/schemas/DataType'
required:
- - name
- - type
- - external_type
- - sample_values
+ - name
+ - type
+ - external_type
+ - sample_values
type: object
DataType:
enum:
- - string
- - boolean
- - integer
- - number
- - date
- - datetime
- - time
- - unknown
+ - string
+ - boolean
+ - integer
+ - number
+ - date
+ - datetime
+ - time
+ - unknown
type: string
Database:
properties:
@@ -716,45 +736,45 @@ components:
$ref: '#/components/schemas/Schema'
type: array
required:
- - name
- - dialect
- - schemas
+ - name
+ - dialect
+ - schemas
type: object
Datasets:
properties:
clear_channel:
enum:
- - local
- - duckdb
- - connection
- - catalog
+ - local
+ - duckdb
+ - connection
+ - catalog
nullable: true
type: string
name:
enum:
- - datasets
+ - datasets
type: string
tables:
items:
$ref: '#/components/schemas/DataTable'
type: array
required:
- - tables
- - name
+ - tables
+ - name
type: object
DeleteCellRequest:
properties:
cellId:
type: string
required:
- - cellId
+ - cellId
type: object
DeleteSecretRequest:
properties:
key:
type: string
required:
- - key
+ - key
type: object
DependencyTreeNode:
properties:
@@ -774,9 +794,9 @@ components:
nullable: true
type: string
required:
- - name
- - tags
- - dependencies
+ - name
+ - tags
+ - dependencies
type: object
DependencyTreeResponse:
properties:
@@ -786,18 +806,18 @@ components:
type: object
Error:
oneOf:
- - $ref: '#/components/schemas/SetupRootError'
- - $ref: '#/components/schemas/CycleError'
- - $ref: '#/components/schemas/MultipleDefinitionError'
- - $ref: '#/components/schemas/ImportStarError'
- - $ref: '#/components/schemas/MarimoAncestorStoppedError'
- - $ref: '#/components/schemas/MarimoAncestorPreventedError'
- - $ref: '#/components/schemas/MarimoExceptionRaisedError'
- - $ref: '#/components/schemas/MarimoStrictExecutionError'
- - $ref: '#/components/schemas/MarimoInterruptionError'
- - $ref: '#/components/schemas/MarimoSyntaxError'
- - $ref: '#/components/schemas/MarimoInternalError'
- - $ref: '#/components/schemas/UnknownError'
+ - $ref: '#/components/schemas/SetupRootError'
+ - $ref: '#/components/schemas/CycleError'
+ - $ref: '#/components/schemas/MultipleDefinitionError'
+ - $ref: '#/components/schemas/ImportStarError'
+ - $ref: '#/components/schemas/MarimoAncestorStoppedError'
+ - $ref: '#/components/schemas/MarimoAncestorPreventedError'
+ - $ref: '#/components/schemas/MarimoExceptionRaisedError'
+ - $ref: '#/components/schemas/MarimoStrictExecutionError'
+ - $ref: '#/components/schemas/MarimoInterruptionError'
+ - $ref: '#/components/schemas/MarimoSyntaxError'
+ - $ref: '#/components/schemas/MarimoInternalError'
+ - $ref: '#/components/schemas/UnknownError'
ExecuteMultipleRequest:
properties:
cellIds:
@@ -814,9 +834,9 @@ components:
timestamp:
type: number
required:
- - cellIds
- - codes
- - timestamp
+ - cellIds
+ - codes
+ - timestamp
type: object
ExecuteScratchpadRequest:
properties:
@@ -826,7 +846,7 @@ components:
$ref: '#/components/schemas/HTTPRequest'
nullable: true
required:
- - code
+ - code
type: object
ExecuteStaleRequest:
properties:
@@ -846,9 +866,9 @@ components:
timestamp:
type: number
required:
- - cellId
- - code
- - timestamp
+ - cellId
+ - code
+ - timestamp
type: object
ExportAsHTMLRequest:
properties:
@@ -864,30 +884,30 @@ components:
includeCode:
type: boolean
required:
- - download
- - files
- - includeCode
+ - download
+ - files
+ - includeCode
type: object
ExportAsIPYNBRequest:
properties:
download:
type: boolean
required:
- - download
+ - download
type: object
ExportAsMarkdownRequest:
properties:
download:
type: boolean
required:
- - download
+ - download
type: object
ExportAsScriptRequest:
properties:
download:
type: boolean
required:
- - download
+ - download
type: object
FileCreateRequest:
properties:
@@ -900,13 +920,13 @@ components:
type: string
type:
enum:
- - file
- - directory
+ - file
+ - directory
type: string
required:
- - path
- - type
- - name
+ - path
+ - type
+ - name
type: object
FileCreateResponse:
properties:
@@ -919,14 +939,14 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FileDeleteRequest:
properties:
path:
type: string
required:
- - path
+ - path
type: object
FileDeleteResponse:
properties:
@@ -936,14 +956,14 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FileDetailsRequest:
properties:
path:
type: string
required:
- - path
+ - path
type: object
FileDetailsResponse:
properties:
@@ -956,7 +976,7 @@ components:
nullable: true
type: string
required:
- - file
+ - file
type: object
FileInfo:
properties:
@@ -978,12 +998,12 @@ components:
path:
type: string
required:
- - id
- - path
- - name
- - isDirectory
- - isMarimoFile
- - children
+ - id
+ - path
+ - name
+ - isDirectory
+ - isMarimoFile
+ - children
type: object
FileListRequest:
properties:
@@ -1000,8 +1020,8 @@ components:
root:
type: string
required:
- - files
- - root
+ - files
+ - root
type: object
FileMoveRequest:
properties:
@@ -1010,8 +1030,8 @@ components:
path:
type: string
required:
- - path
- - newPath
+ - path
+ - newPath
type: object
FileMoveResponse:
properties:
@@ -1024,14 +1044,14 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FileOpenRequest:
properties:
path:
type: string
required:
- - path
+ - path
type: object
FileUpdateRequest:
properties:
@@ -1040,8 +1060,8 @@ components:
path:
type: string
required:
- - path
- - contents
+ - path
+ - contents
type: object
FileUpdateResponse:
properties:
@@ -1054,7 +1074,7 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FocusCell:
properties:
@@ -1062,11 +1082,11 @@ components:
type: string
name:
enum:
- - focus-cell
+ - focus-cell
type: string
required:
- - cell_id
- - name
+ - cell_id
+ - name
type: object
FormatRequest:
properties:
@@ -1077,8 +1097,8 @@ components:
lineLength:
type: integer
required:
- - codes
- - lineLength
+ - codes
+ - lineLength
type: object
FormatResponse:
properties:
@@ -1087,7 +1107,7 @@ components:
type: string
type: object
required:
- - codes
+ - codes
type: object
FunctionCallRequest:
properties:
@@ -1101,10 +1121,10 @@ components:
namespace:
type: string
required:
- - functionCallId
- - namespace
- - functionName
- - args
+ - functionCallId
+ - namespace
+ - functionName
+ - args
type: object
FunctionCallResult:
properties:
@@ -1112,30 +1132,30 @@ components:
type: string
name:
enum:
- - function-call-result
+ - function-call-result
type: string
return_value:
nullable: true
oneOf:
- - additionalProperties:
- $ref: '#/components/schemas/JSONType'
- type: object
- - items:
- $ref: '#/components/schemas/JSONType'
- type: array
- - type: string
- - type: integer
- - type: number
- - type: boolean
- - additionalProperties: true
- type: object
- - $ref: '#/components/schemas/MIME'
+ - additionalProperties:
+ $ref: '#/components/schemas/JSONType'
+ type: object
+ - items:
+ $ref: '#/components/schemas/JSONType'
+ type: array
+ - type: string
+ - type: integer
+ - type: number
+ - type: boolean
+ - additionalProperties: true
+ type: object
+ - $ref: '#/components/schemas/MIME'
status:
$ref: '#/components/schemas/HumanReadableStatus'
required:
- - function_call_id
- - status
- - name
+ - function_call_id
+ - status
+ - name
type: object
GoogleAiConfig:
properties:
@@ -1148,8 +1168,8 @@ components:
properties:
code:
enum:
- - ok
- - error
+ - ok
+ - error
type: string
message:
nullable: true
@@ -1158,7 +1178,7 @@ components:
nullable: true
type: string
required:
- - code
+ - code
type: object
ImportStarError:
properties:
@@ -1166,11 +1186,11 @@ components:
type: string
type:
enum:
- - import-star
+ - import-star
type: string
required:
- - msg
- - type
+ - msg
+ - type
type: object
InstallMissingPackagesRequest:
properties:
@@ -1181,27 +1201,27 @@ components:
type: string
type: object
required:
- - manager
- - versions
+ - manager
+ - versions
type: object
InstallingPackageAlert:
properties:
name:
enum:
- - installing-package-alert
+ - installing-package-alert
type: string
packages:
additionalProperties:
enum:
- - queued
- - installing
- - installed
- - failed
+ - queued
+ - installing
+ - installed
+ - failed
type: string
type: object
required:
- - packages
- - name
+ - packages
+ - name
type: object
InstantiateRequest:
properties:
@@ -1215,18 +1235,18 @@ components:
items: {}
type: array
required:
- - objectIds
- - values
- - autoRun
+ - objectIds
+ - values
+ - autoRun
type: object
Interrupted:
properties:
name:
enum:
- - interrupted
+ - interrupted
type: string
required:
- - name
+ - name
type: object
InvokeAiToolRequest:
properties:
@@ -1236,8 +1256,8 @@ components:
toolName:
type: string
required:
- - toolName
- - arguments
+ - toolName
+ - arguments
type: object
InvokeAiToolResponse:
properties:
@@ -1250,18 +1270,18 @@ components:
toolName:
type: string
required:
- - success
- - toolName
- - result
+ - success
+ - toolName
+ - result
type: object
JSONType:
oneOf:
- - type: string
- - type: number
- - type: object
- - type: array
- - type: boolean
- - type: 'null'
+ - type: string
+ - type: number
+ - type: object
+ - type: array
+ - type: boolean
+ - type: 'null'
KernelReady:
properties:
app_config:
@@ -1272,9 +1292,9 @@ components:
auto_download:
items:
enum:
- - html
- - markdown
- - ipynb
+ - html
+ - markdown
+ - ipynb
type: string
type: array
css_file:
@@ -1288,24 +1308,24 @@ components:
type: string
sql_output:
enum:
- - polars
- - lazy-polars
- - pandas
- - native
- - auto
+ - polars
+ - lazy-polars
+ - pandas
+ - native
+ - auto
type: string
width:
enum:
- - normal
- - compact
- - medium
- - full
- - columns
+ - normal
+ - compact
+ - medium
+ - full
+ - columns
type: string
required:
- - width
- - auto_download
- - sql_output
+ - width
+ - auto_download
+ - sql_output
type: object
capabilities:
properties:
@@ -1318,10 +1338,10 @@ components:
ty:
type: boolean
required:
- - terminal
- - pylsp
- - ty
- - basedpyright
+ - terminal
+ - pylsp
+ - ty
+ - basedpyright
type: object
cell_ids:
items:
@@ -1356,12 +1376,12 @@ components:
type:
type: string
required:
- - type
- - data
+ - type
+ - data
type: object
name:
enum:
- - kernel-ready
+ - kernel-ready
type: string
names:
items:
@@ -1373,59 +1393,59 @@ components:
additionalProperties:
nullable: true
oneOf:
- - additionalProperties:
- nullable: true
- oneOf:
- - additionalProperties:
- $ref: '#/components/schemas/JSONType'
- type: object
- - items:
- $ref: '#/components/schemas/JSONType'
- type: array
- - type: string
- - type: integer
- - type: number
- - type: boolean
- - additionalProperties: true
- type: object
- - $ref: '#/components/schemas/MIME'
- type: object
- - items:
- nullable: true
- oneOf:
- - additionalProperties:
- $ref: '#/components/schemas/JSONType'
- type: object
- - items:
- $ref: '#/components/schemas/JSONType'
- type: array
- - type: string
- - type: integer
- - type: number
- - type: boolean
- - additionalProperties: true
- type: object
- - $ref: '#/components/schemas/MIME'
- type: array
- - type: string
- - type: integer
- - type: number
- - type: boolean
- - additionalProperties: true
- type: object
- - $ref: '#/components/schemas/MIME'
+ - additionalProperties:
+ nullable: true
+ oneOf:
+ - additionalProperties:
+ $ref: '#/components/schemas/JSONType'
+ type: object
+ - items:
+ $ref: '#/components/schemas/JSONType'
+ type: array
+ - type: string
+ - type: integer
+ - type: number
+ - type: boolean
+ - additionalProperties: true
+ type: object
+ - $ref: '#/components/schemas/MIME'
+ type: object
+ - items:
+ nullable: true
+ oneOf:
+ - additionalProperties:
+ $ref: '#/components/schemas/JSONType'
+ type: object
+ - items:
+ $ref: '#/components/schemas/JSONType'
+ type: array
+ - type: string
+ - type: integer
+ - type: number
+ - type: boolean
+ - additionalProperties: true
+ type: object
+ - $ref: '#/components/schemas/MIME'
+ type: array
+ - type: string
+ - type: integer
+ - type: number
+ - type: boolean
+ - additionalProperties: true
+ type: object
+ - $ref: '#/components/schemas/MIME'
nullable: true
type: object
required:
- - cell_ids
- - codes
- - names
- - configs
- - resumed
- - app_config
- - kiosk
- - capabilities
- - name
+ - cell_ids
+ - codes
+ - names
+ - configs
+ - resumed
+ - app_config
+ - kiosk
+ - capabilities
+ - name
type: object
ListPackagesResponse:
properties:
@@ -1434,14 +1454,14 @@ components:
$ref: '#/components/schemas/PackageDescription'
type: array
required:
- - packages
+ - packages
type: object
ListSecretKeysRequest:
properties:
requestId:
type: string
required:
- - requestId
+ - requestId
type: object
ListSecretKeysResponse:
properties:
@@ -1450,7 +1470,7 @@ components:
$ref: '#/components/schemas/SecretKeysWithProvider'
type: array
required:
- - keys
+ - keys
type: object
MIME:
properties: {}
@@ -1466,12 +1486,12 @@ components:
type: string
type:
enum:
- - ancestor-prevented
+ - ancestor-prevented
type: string
required:
- - msg
- - raising_cell
- - type
+ - msg
+ - raising_cell
+ - type
type: object
MarimoAncestorStoppedError:
properties:
@@ -1481,12 +1501,12 @@ components:
type: string
type:
enum:
- - ancestor-stopped
+ - ancestor-stopped
type: string
required:
- - msg
- - raising_cell
- - type
+ - msg
+ - raising_cell
+ - type
type: object
MarimoConfig:
properties:
@@ -1507,39 +1527,39 @@ components:
type: string
copilot:
oneOf:
- - type: boolean
- - enum:
- - github
- - codeium
- - custom
- type: string
+ - type: boolean
+ - enum:
+ - github
+ - codeium
+ - custom
+ type: string
model:
nullable: true
type: string
required:
- - activate_on_typing
- - copilot
+ - activate_on_typing
+ - copilot
type: object
datasources:
properties:
auto_discover_columns:
oneOf:
- - type: boolean
- - enum:
- - auto
- type: string
+ - type: boolean
+ - enum:
+ - auto
+ type: string
auto_discover_schemas:
oneOf:
- - type: boolean
- - enum:
- - auto
- type: string
+ - type: boolean
+ - enum:
+ - auto
+ type: string
auto_discover_tables:
oneOf:
- - type: boolean
- - enum:
- - auto
- type: string
+ - type: boolean
+ - enum:
+ - auto
+ type: string
type: object
diagnostics:
properties:
@@ -1550,8 +1570,8 @@ components:
properties:
cell_output:
enum:
- - above
- - below
+ - above
+ - below
type: string
code_editor_font_size:
type: integer
@@ -1561,8 +1581,8 @@ components:
type: array
dataframes:
enum:
- - rich
- - plain
+ - rich
+ - plain
type: string
default_table_max_columns:
type: integer
@@ -1570,28 +1590,28 @@ components:
type: integer
default_width:
enum:
- - normal
- - compact
- - medium
- - full
- - columns
+ - normal
+ - compact
+ - medium
+ - full
+ - columns
type: string
reference_highlighting:
type: boolean
theme:
enum:
- - light
- - dark
- - system
+ - light
+ - dark
+ - system
type: string
required:
- - theme
- - code_editor_font_size
- - cell_output
- - default_width
- - dataframes
- - default_table_page_size
- - default_table_max_columns
+ - theme
+ - code_editor_font_size
+ - cell_output
+ - default_width
+ - dataframes
+ - default_table_page_size
+ - default_table_max_columns
type: object
experimental:
additionalProperties: {}
@@ -1601,7 +1621,7 @@ components:
line_length:
type: integer
required:
- - line_length
+ - line_length
type: object
keymap:
properties:
@@ -1613,14 +1633,14 @@ components:
type: object
preset:
enum:
- - default
- - vim
+ - default
+ - vim
type: string
vimrc:
nullable: true
type: string
required:
- - preset
+ - preset
type: object
language_servers:
properties:
@@ -1656,14 +1676,14 @@ components:
properties:
manager:
enum:
- - pip
- - rye
- - uv
- - poetry
- - pixi
+ - pip
+ - rye
+ - uv
+ - poetry
+ - pixi
type: string
required:
- - manager
+ - manager
type: object
runtime:
properties:
@@ -1671,25 +1691,25 @@ components:
type: boolean
auto_reload:
enum:
- - 'off'
- - lazy
- - autorun
+ - 'off'
+ - lazy
+ - autorun
type: string
default_auto_download:
items:
enum:
- - html
- - markdown
- - ipynb
+ - html
+ - markdown
+ - ipynb
type: string
type: array
default_sql_output:
enum:
- - polars
- - lazy-polars
- - pandas
- - native
- - auto
+ - polars
+ - lazy-polars
+ - pandas
+ - native
+ - auto
type: string
dotenv:
items:
@@ -1697,8 +1717,8 @@ components:
type: array
on_cell_change:
enum:
- - lazy
- - autorun
+ - lazy
+ - autorun
type: string
output_max_bytes:
type: integer
@@ -1712,48 +1732,48 @@ components:
type: integer
watcher_on_save:
enum:
- - lazy
- - autorun
+ - lazy
+ - autorun
type: string
required:
- - auto_instantiate
- - auto_reload
- - reactive_tests
- - on_cell_change
- - watcher_on_save
- - output_max_bytes
- - std_stream_max_bytes
- - default_sql_output
+ - auto_instantiate
+ - auto_reload
+ - reactive_tests
+ - on_cell_change
+ - watcher_on_save
+ - output_max_bytes
+ - std_stream_max_bytes
+ - default_sql_output
type: object
save:
properties:
autosave:
enum:
- - 'off'
- - after_delay
+ - 'off'
+ - after_delay
type: string
autosave_delay:
type: integer
format_on_save:
type: boolean
required:
- - autosave
- - autosave_delay
- - format_on_save
+ - autosave
+ - autosave_delay
+ - format_on_save
type: object
server:
properties:
browser:
oneOf:
- - enum:
- - default
- type: string
- - type: string
+ - enum:
+ - default
+ type: string
+ - type: string
follow_symlink:
type: boolean
required:
- - browser
- - follow_symlink
+ - browser
+ - follow_symlink
type: object
sharing:
properties:
@@ -1772,14 +1792,14 @@ components:
type: boolean
type: object
required:
- - completion
- - display
- - formatting
- - keymap
- - runtime
- - save
- - server
- - package_management
+ - completion
+ - display
+ - formatting
+ - keymap
+ - runtime
+ - save
+ - server
+ - package_management
type: object
MarimoExceptionRaisedError:
properties:
@@ -1792,12 +1812,12 @@ components:
type: string
type:
enum:
- - exception
+ - exception
type: string
required:
- - msg
- - exception_type
- - type
+ - msg
+ - exception_type
+ - type
type: object
MarimoFile:
properties:
@@ -1815,8 +1835,8 @@ components:
nullable: true
type: string
required:
- - name
- - path
+ - name
+ - path
type: object
MarimoInternalError:
properties:
@@ -1826,21 +1846,21 @@ components:
type: string
type:
enum:
- - internal
+ - internal
type: string
required:
- - error_id
- - type
- - msg
+ - error_id
+ - type
+ - msg
type: object
MarimoInterruptionError:
properties:
type:
enum:
- - interruption
+ - interruption
type: string
required:
- - type
+ - type
type: object
MarimoStrictExecutionError:
properties:
@@ -1853,12 +1873,12 @@ components:
type: string
type:
enum:
- - strict-exception
+ - strict-exception
type: string
required:
- - msg
- - ref
- - type
+ - msg
+ - ref
+ - type
type: object
MarimoSyntaxError:
properties:
@@ -1866,66 +1886,66 @@ components:
type: string
type:
enum:
- - syntax
+ - syntax
type: string
required:
- - msg
- - type
+ - msg
+ - type
type: object
MessageOperation:
oneOf:
- - $ref: '#/components/schemas/CellOp'
- - $ref: '#/components/schemas/FunctionCallResult'
- - $ref: '#/components/schemas/SendUIElementMessage'
- - $ref: '#/components/schemas/RemoveUIElements'
- - $ref: '#/components/schemas/Reload'
- - $ref: '#/components/schemas/Reconnected'
- - $ref: '#/components/schemas/Interrupted'
- - $ref: '#/components/schemas/CompletedRun'
- - $ref: '#/components/schemas/KernelReady'
- - $ref: '#/components/schemas/CompletionResult'
- - $ref: '#/components/schemas/Alert'
- - $ref: '#/components/schemas/Banner'
- - $ref: '#/components/schemas/MissingPackageAlert'
- - $ref: '#/components/schemas/InstallingPackageAlert'
- - $ref: '#/components/schemas/Variables'
- - $ref: '#/components/schemas/VariableValues'
- - $ref: '#/components/schemas/QueryParamsSet'
- - $ref: '#/components/schemas/QueryParamsAppend'
- - $ref: '#/components/schemas/QueryParamsDelete'
- - $ref: '#/components/schemas/QueryParamsClear'
- - $ref: '#/components/schemas/Datasets'
- - $ref: '#/components/schemas/DataColumnPreview'
- - $ref: '#/components/schemas/SQLTablePreview'
- - $ref: '#/components/schemas/SQLTableListPreview'
- - $ref: '#/components/schemas/DataSourceConnections'
- - $ref: '#/components/schemas/SecretKeysResult'
- - $ref: '#/components/schemas/FocusCell'
- - $ref: '#/components/schemas/UpdateCellCodes'
- - $ref: '#/components/schemas/UpdateCellIdsRequest'
+ - $ref: '#/components/schemas/CellOp'
+ - $ref: '#/components/schemas/FunctionCallResult'
+ - $ref: '#/components/schemas/SendUIElementMessage'
+ - $ref: '#/components/schemas/RemoveUIElements'
+ - $ref: '#/components/schemas/Reload'
+ - $ref: '#/components/schemas/Reconnected'
+ - $ref: '#/components/schemas/Interrupted'
+ - $ref: '#/components/schemas/CompletedRun'
+ - $ref: '#/components/schemas/KernelReady'
+ - $ref: '#/components/schemas/CompletionResult'
+ - $ref: '#/components/schemas/Alert'
+ - $ref: '#/components/schemas/Banner'
+ - $ref: '#/components/schemas/MissingPackageAlert'
+ - $ref: '#/components/schemas/InstallingPackageAlert'
+ - $ref: '#/components/schemas/Variables'
+ - $ref: '#/components/schemas/VariableValues'
+ - $ref: '#/components/schemas/QueryParamsSet'
+ - $ref: '#/components/schemas/QueryParamsAppend'
+ - $ref: '#/components/schemas/QueryParamsDelete'
+ - $ref: '#/components/schemas/QueryParamsClear'
+ - $ref: '#/components/schemas/Datasets'
+ - $ref: '#/components/schemas/DataColumnPreview'
+ - $ref: '#/components/schemas/SQLTablePreview'
+ - $ref: '#/components/schemas/SQLTableListPreview'
+ - $ref: '#/components/schemas/DataSourceConnections'
+ - $ref: '#/components/schemas/SecretKeysResult'
+ - $ref: '#/components/schemas/FocusCell'
+ - $ref: '#/components/schemas/UpdateCellCodes'
+ - $ref: '#/components/schemas/UpdateCellIdsRequest'
MimeType:
enum:
- - application/json
- - application/vnd.marimo+error
- - application/vnd.marimo+traceback
- - application/vnd.marimo+mimebundle
- - application/vnd.vega.v5+json
- - application/vnd.vegalite.v5+json
- - application/vnd.jupyter.widget-view+json
- - image/png
- - image/svg+xml
- - image/tiff
- - image/avif
- - image/bmp
- - image/gif
- - image/jpeg
- - video/mp4
- - video/mpeg
- - text/html
- - text/plain
- - text/markdown
- - text/latex
- - text/csv
+ - application/json
+ - application/vnd.marimo+error
+ - application/vnd.marimo+traceback
+ - application/vnd.marimo+mimebundle
+ - application/vnd.vega.v5+json
+ - application/vnd.vegalite.v5+json
+ - application/vnd.jupyter.widget-view+json
+ - image/png
+ - image/svg+xml
+ - image/tiff
+ - image/avif
+ - image/bmp
+ - image/gif
+ - image/jpeg
+ - video/mp4
+ - video/mpeg
+ - text/html
+ - text/plain
+ - text/markdown
+ - text/latex
+ - text/csv
type: string
MissingPackageAlert:
properties:
@@ -1933,16 +1953,16 @@ components:
type: boolean
name:
enum:
- - missing-package-alert
+ - missing-package-alert
type: string
packages:
items:
type: string
type: array
required:
- - packages
- - isolated
- - name
+ - packages
+ - isolated
+ - name
type: object
MultipleDefinitionError:
properties:
@@ -1954,29 +1974,29 @@ components:
type: string
type:
enum:
- - multiple-defs
+ - multiple-defs
type: string
required:
- - name
- - cells
- - type
+ - name
+ - cells
+ - type
type: object
NonNestedLiteral:
oneOf:
- - type: integer
- - type: number
- - format: date
- type: string
- - format: time
- type: string
- - format: date-time
- type: string
- - format: duration
- type: string
- - type: string
- - type: boolean
- - format: byte
- type: string
+ - type: integer
+ - type: number
+ - format: date
+ type: string
+ - format: time
+ type: string
+ - format: date-time
+ type: string
+ - format: duration
+ type: string
+ - type: string
+ - type: boolean
+ - format: byte
+ type: string
OpenAiConfig:
properties:
api_key:
@@ -1996,22 +2016,22 @@ components:
properties:
tutorialId:
oneOf:
- - enum:
- - intro
- - dataflow
- - ui
- - markdown
- - plots
- - sql
- - layout
- - fileformat
- - for-jupyter-users
- type: string
- - enum:
- - markdown-format
- type: string
+ - enum:
+ - intro
+ - dataflow
+ - ui
+ - markdown
+ - plots
+ - sql
+ - layout
+ - fileformat
+ - for-jupyter-users
+ type: string
+ - enum:
+ - markdown-format
+ type: string
required:
- - tutorialId
+ - tutorialId
type: object
PackageDescription:
properties:
@@ -2020,8 +2040,8 @@ components:
version:
type: string
required:
- - name
- - version
+ - name
+ - version
type: object
PackageOperationResponse:
properties:
@@ -2031,7 +2051,7 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
PdbRequest:
properties:
@@ -2041,14 +2061,14 @@ components:
$ref: '#/components/schemas/HTTPRequest'
nullable: true
required:
- - cellId
+ - cellId
type: object
PreviewDataSourceConnectionRequest:
properties:
engine:
type: string
required:
- - engine
+ - engine
type: object
PreviewDatasetColumnRequest:
properties:
@@ -2061,18 +2081,18 @@ components:
type: string
sourceType:
enum:
- - local
- - duckdb
- - connection
- - catalog
+ - local
+ - duckdb
+ - connection
+ - catalog
type: string
tableName:
type: string
required:
- - sourceType
- - source
- - tableName
- - columnName
+ - sourceType
+ - source
+ - tableName
+ - columnName
type: object
PreviewSQLTableListRequest:
properties:
@@ -2085,10 +2105,10 @@ components:
schema:
type: string
required:
- - requestId
- - engine
- - database
- - schema
+ - requestId
+ - engine
+ - database
+ - schema
type: object
PreviewSQLTableRequest:
properties:
@@ -2103,11 +2123,11 @@ components:
tableName:
type: string
required:
- - requestId
- - engine
- - database
- - schema
- - tableName
+ - requestId
+ - engine
+ - database
+ - schema
+ - tableName
type: object
QueryParamsAppend:
properties:
@@ -2115,23 +2135,23 @@ components:
type: string
name:
enum:
- - query-params-append
+ - query-params-append
type: string
value:
type: string
required:
- - key
- - value
- - name
+ - key
+ - value
+ - name
type: object
QueryParamsClear:
properties:
name:
enum:
- - query-params-clear
+ - query-params-clear
type: string
required:
- - name
+ - name
type: object
QueryParamsDelete:
properties:
@@ -2139,14 +2159,14 @@ components:
type: string
name:
enum:
- - query-params-delete
+ - query-params-delete
type: string
value:
nullable: true
type: string
required:
- - key
- - name
+ - key
+ - name
type: object
QueryParamsSet:
properties:
@@ -2154,25 +2174,25 @@ components:
type: string
name:
enum:
- - query-params-set
+ - query-params-set
type: string
value:
oneOf:
- - type: string
- - items:
- type: string
- type: array
+ - type: string
+ - items:
+ type: string
+ type: array
required:
- - key
- - value
- - name
+ - key
+ - value
+ - name
type: object
ReadCodeResponse:
properties:
contents:
type: string
required:
- - contents
+ - contents
type: object
RecentFilesResponse:
properties:
@@ -2181,32 +2201,32 @@ components:
$ref: '#/components/schemas/MarimoFile'
type: array
required:
- - files
+ - files
type: object
Reconnected:
properties:
name:
enum:
- - reconnected
+ - reconnected
type: string
required:
- - name
+ - name
type: object
Reload:
properties:
name:
enum:
- - reload
+ - reload
type: string
required:
- - name
+ - name
type: object
RemovePackageRequest:
properties:
package:
type: string
required:
- - package
+ - package
type: object
RemoveUIElements:
properties:
@@ -2214,25 +2234,25 @@ components:
type: string
name:
enum:
- - remove-ui-elements
+ - remove-ui-elements
type: string
required:
- - cell_id
- - name
+ - cell_id
+ - name
type: object
RenameFileRequest:
properties:
filename:
type: string
required:
- - filename
+ - filename
type: object
RenameRequest:
properties:
filename:
type: string
required:
- - filename
+ - filename
type: object
RunRequest:
properties:
@@ -2248,8 +2268,8 @@ components:
$ref: '#/components/schemas/HTTPRequest'
nullable: true
required:
- - cellIds
- - codes
+ - cellIds
+ - codes
type: object
RunningNotebooksResponse:
properties:
@@ -2258,14 +2278,14 @@ components:
$ref: '#/components/schemas/MarimoFile'
type: array
required:
- - files
+ - files
type: object
RuntimeState:
enum:
- - idle
- - queued
- - running
- - disabled-transitively
+ - idle
+ - queued
+ - running
+ - disabled-transitively
type: string
SQLTableListPreview:
properties:
@@ -2274,7 +2294,7 @@ components:
type: string
name:
enum:
- - sql-table-list-preview
+ - sql-table-list-preview
type: string
request_id:
type: string
@@ -2283,9 +2303,9 @@ components:
$ref: '#/components/schemas/DataTable'
type: array
required:
- - request_id
- - tables
- - name
+ - request_id
+ - tables
+ - name
type: object
SQLTablePreview:
properties:
@@ -2294,7 +2314,7 @@ components:
type: string
name:
enum:
- - sql-table-preview
+ - sql-table-preview
type: string
request_id:
type: string
@@ -2302,8 +2322,8 @@ components:
$ref: '#/components/schemas/DataTable'
nullable: true
required:
- - request_id
- - name
+ - request_id
+ - name
type: object
SaveAppConfigurationRequest:
properties:
@@ -2311,7 +2331,7 @@ components:
additionalProperties: {}
type: object
required:
- - config
+ - config
type: object
SaveNotebookRequest:
properties:
@@ -2340,19 +2360,19 @@ components:
persist:
type: boolean
required:
- - cellIds
- - codes
- - names
- - configs
- - filename
- - persist
+ - cellIds
+ - codes
+ - names
+ - configs
+ - filename
+ - persist
type: object
SaveUserConfigurationRequest:
properties:
config:
$ref: '#/components/schemas/MarimoConfig'
required:
- - config
+ - config
type: object
Schema:
properties:
@@ -2363,8 +2383,8 @@ components:
$ref: '#/components/schemas/DataTable'
type: array
required:
- - name
- - tables
+ - name
+ - tables
type: object
SchemaColumn:
properties:
@@ -2376,9 +2396,9 @@ components:
type:
type: string
required:
- - name
- - type
- - sampleValues
+ - name
+ - type
+ - sampleValues
type: object
SchemaTable:
properties:
@@ -2389,14 +2409,14 @@ components:
name:
type: string
required:
- - name
- - columns
+ - name
+ - columns
type: object
SecretKeysResult:
properties:
name:
enum:
- - secret-keys-result
+ - secret-keys-result
type: string
request_id:
type: string
@@ -2405,9 +2425,9 @@ components:
$ref: '#/components/schemas/SecretKeysWithProvider'
type: array
required:
- - request_id
- - secrets
- - name
+ - request_id
+ - secrets
+ - name
type: object
SecretKeysWithProvider:
properties:
@@ -2419,13 +2439,13 @@ components:
type: string
provider:
enum:
- - env
- - dotenv
+ - env
+ - dotenv
type: string
required:
- - provider
- - name
- - keys
+ - provider
+ - name
+ - keys
type: object
SendUIElementMessage:
properties:
@@ -2442,14 +2462,14 @@ components:
type: string
name:
enum:
- - send-ui-element-message
+ - send-ui-element-message
type: string
ui_element:
nullable: true
type: string
required:
- - message
- - name
+ - message
+ - name
type: object
SetCellConfigRequest:
properties:
@@ -2459,7 +2479,7 @@ components:
type: object
type: object
required:
- - configs
+ - configs
type: object
SetModelMessageRequest:
properties:
@@ -2474,22 +2494,22 @@ components:
items:
items:
oneOf:
- - type: string
- - type: integer
+ - type: string
+ - type: integer
type: array
type: array
state:
additionalProperties: {}
type: object
required:
- - state
- - bufferPaths
+ - state
+ - bufferPaths
type: object
modelId:
type: string
required:
- - modelId
- - message
+ - modelId
+ - message
type: object
SetUIElementValueRequest:
properties:
@@ -2506,43 +2526,43 @@ components:
items: {}
type: array
required:
- - objectIds
- - values
- - token
+ - objectIds
+ - values
+ - token
type: object
SetUserConfigRequest:
properties:
config:
$ref: '#/components/schemas/MarimoConfig'
required:
- - config
+ - config
type: object
SetupRootError:
properties:
edges_with_vars:
items:
prefixItems:
- - type: string
- - items:
- type: string
- type: array
- - type: string
+ - type: string
+ - items:
+ type: string
+ type: array
+ - type: string
type: array
type: array
type:
enum:
- - setup-refs
+ - setup-refs
type: string
required:
- - edges_with_vars
- - type
+ - edges_with_vars
+ - type
type: object
ShutdownSessionRequest:
properties:
sessionId:
type: string
required:
- - sessionId
+ - sessionId
type: object
Snippet:
properties:
@@ -2553,8 +2573,8 @@ components:
title:
type: string
required:
- - title
- - sections
+ - title
+ - sections
type: object
SnippetSection:
properties:
@@ -2567,7 +2587,7 @@ components:
id:
type: string
required:
- - id
+ - id
type: object
Snippets:
properties:
@@ -2576,14 +2596,14 @@ components:
$ref: '#/components/schemas/Snippet'
type: array
required:
- - snippets
+ - snippets
type: object
StdinRequest:
properties:
text:
type: string
required:
- - text
+ - text
type: object
StopRequest:
properties: {}
@@ -2593,7 +2613,7 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
UnknownError:
properties:
@@ -2601,11 +2621,11 @@ components:
type: string
type:
enum:
- - unknown
+ - unknown
type: string
required:
- - msg
- - type
+ - msg
+ - type
type: object
UpdateCellCodes:
properties:
@@ -2621,13 +2641,13 @@ components:
type: array
name:
enum:
- - update-cell-codes
+ - update-cell-codes
type: string
required:
- - cell_ids
- - codes
- - code_is_stale
- - name
+ - cell_ids
+ - codes
+ - code_is_stale
+ - name
type: object
UpdateCellIdsRequest:
properties:
@@ -2637,11 +2657,11 @@ components:
type: array
name:
enum:
- - update-cell-ids
+ - update-cell-ids
type: string
required:
- - cell_ids
- - name
+ - cell_ids
+ - name
type: object
UpdateComponentValuesRequest:
properties:
@@ -2653,8 +2673,8 @@ components:
items: {}
type: array
required:
- - objectIds
- - values
+ - objectIds
+ - values
type: object
VariableContext:
properties:
@@ -2664,9 +2684,9 @@ components:
valueType:
type: string
required:
- - name
- - valueType
- - previewValue
+ - name
+ - valueType
+ - previewValue
type: object
VariableDeclaration:
properties:
@@ -2681,9 +2701,9 @@ components:
type: string
type: array
required:
- - name
- - declared_by
- - used_by
+ - name
+ - declared_by
+ - used_by
type: object
VariableValue:
properties:
@@ -2696,42 +2716,42 @@ components:
nullable: true
type: string
required:
- - name
+ - name
type: object
VariableValues:
properties:
name:
enum:
- - variable-values
+ - variable-values
type: string
variables:
items:
$ref: '#/components/schemas/VariableValue'
type: array
required:
- - variables
- - name
+ - variables
+ - name
type: object
Variables:
properties:
name:
enum:
- - variables
+ - variables
type: string
variables:
items:
$ref: '#/components/schemas/VariableDeclaration'
type: array
required:
- - variables
- - name
+ - variables
+ - name
type: object
WorkspaceFilesRequest:
properties:
includeMarkdown:
type: boolean
required:
- - includeMarkdown
+ - includeMarkdown
type: object
WorkspaceFilesResponse:
properties:
@@ -2742,8 +2762,8 @@ components:
root:
type: string
required:
- - root
- - files
+ - root
+ - files
type: object
info:
title: marimo API
@@ -2753,12 +2773,12 @@ paths:
/@file/{filename_and_length}:
get:
parameters:
- - description: The filename and byte length of the virtual file
- in: path
- name: filename_and_length
- required: true
- schema:
- type: string
+ - description: The filename and byte length of the virtual file
+ in: path
+ name: filename_and_length
+ required: true
+ schema:
+ type: string
responses:
200:
content:
@@ -3603,7 +3623,7 @@ paths:
percent:
type: number
required:
- - percent
+ - percent
type: object
gpu:
items:
@@ -3621,17 +3641,17 @@ paths:
used:
type: integer
required:
- - total
- - used
- - free
- - percent
+ - total
+ - used
+ - free
+ - percent
type: object
name:
type: string
required:
- - index
- - memory
- - name
+ - index
+ - memory
+ - name
type: object
type: array
kernel:
@@ -3652,22 +3672,22 @@ paths:
used:
type: integer
required:
- - total
- - available
- - percent
- - used
- - free
+ - total
+ - available
+ - percent
+ - used
+ - free
type: object
server:
properties:
memory:
type: integer
required:
- - memory
+ - memory
type: object
required:
- - memory
- - cpu
+ - memory
+ - cpu
type: object
description: Get the current memory and CPU usage of the application
/api/version:
@@ -3705,5 +3725,4 @@ paths:
type: string
summary: Submit login form
tags:
- - auth
-
+ - auth
diff --git a/packages/openapi/src/api.ts b/packages/openapi/src/api.ts
index 77ec296076..5a545f24a8 100644
--- a/packages/openapi/src/api.ts
+++ b/packages/openapi/src/api.ts
@@ -2572,6 +2572,13 @@ export interface components {
max_tokens?: number;
/** @enum {string} */
mode?: "ask" | "manual";
+ models?: {
+ autocomplete_model?: string;
+ chat_model?: string;
+ custom_models: string[];
+ edit_model?: string;
+ displayed_models: string[];
+ };
ollama?: components["schemas"]["OpenAiConfig"];
open_ai?: components["schemas"]["OpenAiConfig"];
open_ai_compatible?: components["schemas"]["OpenAiConfig"];
diff --git a/tests/_config/test_config.py b/tests/_config/test_config.py
index c5a1fd953c..23b8fbc8ae 100644
--- a/tests/_config/test_config.py
+++ b/tests/_config/test_config.py
@@ -57,8 +57,14 @@ def test_merge_config() -> None:
},
)
)
- assert prev_config["ai"]["open_ai"]["api_key"] == "super_secret"
- assert prev_config["ai"]["google"]["api_key"] == "google_secret"
+ assert (
+ prev_config.get("ai", {}).get("open_ai", {}).get("api_key")
+ == "super_secret"
+ )
+ assert (
+ prev_config.get("ai", {}).get("google", {}).get("api_key")
+ == "google_secret"
+ )
new_config = merge_config(
prev_config,
@@ -74,9 +80,17 @@ def test_merge_config() -> None:
),
)
- assert new_config["ai"]["open_ai"]["api_key"] == "super_secret"
- assert new_config["ai"]["open_ai"]["model"] == "davinci"
- assert new_config["ai"]["google"]["api_key"] == "google_secret"
+ assert (
+ new_config.get("ai", {}).get("open_ai", {}).get("api_key")
+ == "super_secret"
+ )
+ assert (
+ new_config.get("ai", {}).get("open_ai", {}).get("model") == "davinci"
+ )
+ assert (
+ new_config.get("ai", {}).get("google", {}).get("api_key")
+ == "google_secret"
+ )
def test_merge_config_with_keymap_overrides() -> None:
@@ -108,8 +122,11 @@ def test_merge_config_with_keymap_overrides() -> None:
)
assert new_config["keymap"]["preset"] == "vim"
- assert "run-all" not in new_config["keymap"]["overrides"]
- assert new_config["keymap"]["overrides"]["run-cell"] == "ctrl-enter"
+ assert "run-all" not in new_config.get("keymap", {}).get("overrides", {})
+ assert (
+ new_config.get("keymap", {}).get("overrides", {}).get("run-cell")
+ == "ctrl-enter"
+ )
new_config = merge_config(
prev_config,
@@ -122,4 +139,258 @@ def test_merge_config_with_keymap_overrides() -> None:
)
assert new_config["keymap"]["preset"] == "vim"
- assert new_config["keymap"]["overrides"] == {}
+ assert new_config.get("keymap", {}).get("overrides", {}) == {}
+
+
+def test_merge_config_openai_model_fallback() -> None:
+ """Test that openai_model is used as fallback for missing chat_model and edit_model."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ ai={
+ "open_ai": {
+ "api_key": "test_key",
+ "model": "gpt-4",
+ },
+ }
+ ),
+ )
+
+ # When neither chat_model nor edit_model are present, openai_model should be used for both
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("chat_model") == "gpt-4"
+ )
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("edit_model") == "gpt-4"
+ )
+ assert new_config.get("ai", {}).get("open_ai", {}).get("model") == "gpt-4"
+
+
+def test_merge_config_existing_chat_edit_models_no_fallback() -> None:
+ """Test that existing chat_model and edit_model are preserved (no fallback)."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ ai={
+ "open_ai": {
+ "api_key": "test_key",
+ "model": "gpt-4",
+ },
+ "models": {
+ "chat_model": "claude-3-sonnet",
+ "edit_model": "gpt-3.5-turbo",
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ }
+ ),
+ )
+
+ # Existing models should be preserved, not overridden by openai_model
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("chat_model")
+ == "claude-3-sonnet"
+ )
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("edit_model")
+ == "gpt-3.5-turbo"
+ )
+ assert new_config.get("ai", {}).get("open_ai", {}).get("model") == "gpt-4"
+
+
+def test_merge_config_no_openai_model_no_fallback() -> None:
+ """Test that no fallback happens when openai_model is not present."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ ai={
+ "open_ai": {
+ "api_key": "test_key",
+ },
+ }
+ ),
+ )
+
+ # No models should be set since openai_model is not present
+ assert "chat_model" not in new_config.get("ai", {}).get("models", {})
+ assert "edit_model" not in new_config.get("ai", {}).get("models", {})
+
+
+def test_merge_config_partial_model_config() -> None:
+ """Test fallback when only one of chat_model or edit_model is present."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ # Test with only chat_model present
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ ai={
+ "open_ai": {
+ "api_key": "test_key",
+ "model": "gpt-4",
+ },
+ "models": {
+ "chat_model": "claude-3-sonnet",
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ }
+ ),
+ )
+
+ # chat_model should be preserved, but no fallback should happen since chat_model exists
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("chat_model")
+ == "claude-3-sonnet"
+ )
+ assert "edit_model" not in new_config.get("ai", {}).get("models", {})
+
+ # Test with only edit_model present
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ ai={
+ "open_ai": {
+ "api_key": "test_key",
+ "model": "gpt-4",
+ },
+ "models": {
+ "edit_model": "gpt-3.5-turbo",
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ }
+ ),
+ )
+
+ # edit_model should be preserved, but no fallback should happen since edit_model exists
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("edit_model")
+ == "gpt-3.5-turbo"
+ )
+ assert "chat_model" not in new_config.get("ai", {}).get("models", {})
+
+
+def test_merge_config_empty_models_with_openai_model() -> None:
+ """Test fallback when models config exists but chat_model and edit_model are empty/None."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ ai={
+ "open_ai": {
+ "api_key": "test_key",
+ "model": "gpt-4",
+ },
+ "models": {
+ "chat_model": "",
+ "edit_model": "",
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ }
+ ),
+ )
+
+ # Empty/None values should trigger fallback to openai_model
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("chat_model") == "gpt-4"
+ )
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("edit_model") == "gpt-4"
+ )
+
+
+def test_merge_config_completion_model_migration() -> None:
+ """Test that completion.model is migrated to ai.models.autocomplete_model."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ completion={
+ "activate_on_typing": True,
+ "copilot": "custom",
+ "model": "custom-model-v1",
+ }
+ ),
+ )
+
+ # completion.model should be migrated to ai.models.autocomplete_model
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("autocomplete_model")
+ == "custom-model-v1"
+ )
+ # Original completion.model should still exist for backward compatibility
+ assert new_config.get("completion", {}).get("model") == "custom-model-v1"
+
+
+def test_merge_config_completion_model_no_migration_when_autocomplete_exists() -> (
+ None
+):
+ """Test that completion.model is not migrated when ai.models.autocomplete_model already exists."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ completion={
+ "activate_on_typing": True,
+ "copilot": "custom",
+ "model": "old-model",
+ },
+ ai={
+ "models": {
+ "autocomplete_model": "new-model",
+ "displayed_models": [],
+ "custom_models": [],
+ }
+ },
+ ),
+ )
+
+ # ai.models.autocomplete_model should not be overridden
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("autocomplete_model")
+ == "new-model"
+ )
+ # Original completion.model should still exist
+ assert new_config.get("completion", {}).get("model") == "old-model"
+
+
+def test_merge_config_completion_model_migration_creates_ai_config() -> None:
+ """Test that completion.model migration creates ai config when it doesn't exist."""
+ base_config = merge_default_config(PartialMarimoConfig())
+
+ new_config = merge_config(
+ base_config,
+ PartialMarimoConfig(
+ completion={
+ "activate_on_typing": True,
+ "copilot": "custom",
+ "model": "custom-model",
+ }
+ ),
+ )
+
+ # Should create ai.models config with the migrated model
+ assert "ai" in new_config
+ assert "models" in new_config.get("ai", {})
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("autocomplete_model")
+ == "custom-model"
+ )
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("displayed_models")
+ == []
+ )
+ assert (
+ new_config.get("ai", {}).get("models", {}).get("custom_models") == []
+ )
diff --git a/tests/_server/ai/test_ai_config.py b/tests/_server/ai/test_ai_config.py
index e379e49ed6..2ac01fb1e3 100644
--- a/tests/_server/ai/test_ai_config.py
+++ b/tests/_server/ai/test_ai_config.py
@@ -10,7 +10,6 @@ from starlette.exceptions import HTTPException
from marimo._config.config import (
AiConfig,
- CompletionConfig,
MarimoConfig,
)
from marimo._server.ai.config import (
@@ -20,8 +19,10 @@ from marimo._server.ai.config import (
_get_ai_config,
_get_base_url,
_get_key,
+ get_autocomplete_model,
+ get_chat_model,
+ get_edit_model,
get_max_tokens,
- get_model,
)
from marimo._server.ai.tools import Tool
from marimo._server.api.status import HTTPStatus
@@ -178,21 +179,6 @@ class TestAnyProviderConfig:
# Note: base_url is None because _get_base_url doesn't get "Bedrock" name parameter
assert provider_config.base_url is None
- def test_for_completion(self):
- """Test completion configuration."""
- config: CompletionConfig = {
- "activate_on_typing": True,
- "copilot": "custom",
- "api_key": "test-completion-key",
- "base_url": "https://completion.service.com",
- }
-
- provider_config = AnyProviderConfig.for_completion(config)
-
- assert provider_config.api_key == "test-completion-key"
- assert provider_config.base_url == "https://completion.service.com"
- assert provider_config.tools == [] # Completion never uses tools
-
def test_for_model_openai(self) -> None:
"""Test for_model with OpenAI model."""
config: AiConfig = {"open_ai": {"api_key": "test-key"}}
@@ -685,27 +671,38 @@ class TestUtilityFunctions:
def test_get_model_with_openai_config(self):
"""Test getting model from OpenAI config."""
config: AiConfig = {
- "open_ai": {"model": "gpt-4", "api_key": "test-key"}
+ "models": {
+ "chat_model": "gpt-4",
+ "edit_model": "gpt-5",
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ "open_ai": {"api_key": "test-key"},
}
- result = get_model(config)
-
+ result = get_chat_model(config)
assert result == "gpt-4"
+ result = get_edit_model(config)
+ assert result == "gpt-5"
+
def test_get_model_default(self):
"""Test getting default model when not specified."""
- config: AiConfig = {"open_ai": {"api_key": "test-key"}}
-
- result = get_model(config)
+ config: AiConfig = {
+ "models": {
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ "open_ai": {"api_key": "test-key"},
+ }
+ result = get_chat_model(config)
assert result == DEFAULT_MODEL
- def test_get_model_no_openai_config(self):
- """Test getting default model when no OpenAI config."""
- config: AiConfig = {}
-
- result = get_model(config)
+ result = get_edit_model(config)
+ assert result == DEFAULT_MODEL
+ result = get_autocomplete_model({"ai": config})
assert result == DEFAULT_MODEL
def test_get_max_tokens_from_config(self):
@@ -747,6 +744,98 @@ class TestUtilityFunctions:
assert result == DEFAULT_MAX_TOKENS
+ def test_get_autocomplete_model(self) -> None:
+ """Test get_autocomplete_model with new ai.models.autocomplete_model config."""
+
+ config: AiConfig = {
+ "models": {
+ "chat_model": "openai/gpt-4o",
+ "edit_model": "openai/gpt-4o-mini",
+ "autocomplete_model": "openai/gpt-3.5-turbo-instruct",
+ "displayed_models": [],
+ "custom_models": [],
+ }
+ }
+
+ assert (
+ get_autocomplete_model({"ai": config})
+ == "openai/gpt-3.5-turbo-instruct"
+ )
+
+ def test_get_chat_model(self) -> None:
+ """Test get_chat_model with new ai.models.chat_model config."""
+
+ config: AiConfig = {
+ "models": {
+ "chat_model": "anthropic/claude-3-5-sonnet-20241022",
+ "edit_model": "openai/gpt-4o-mini",
+ "displayed_models": [],
+ "custom_models": [],
+ }
+ }
+
+ assert get_chat_model(config) == "anthropic/claude-3-5-sonnet-20241022"
+
+ def test_get_edit_model(self) -> None:
+ """Test get_edit_model with new ai.models.edit_model config."""
+
+ config: AiConfig = {
+ "models": {
+ "chat_model": "openai/gpt-4o",
+ "edit_model": "anthropic/claude-3-5-haiku-20241022",
+ "displayed_models": [],
+ "custom_models": [],
+ }
+ }
+
+ assert get_edit_model(config) == "anthropic/claude-3-5-haiku-20241022"
+
+ def test_get_edit_model_fallback_to_chat_model(self) -> None:
+ """Test get_edit_model falls back to chat_model when edit_model is not set."""
+
+ config: AiConfig = {
+ "models": {
+ "chat_model": "openai/gpt-4o",
+ "displayed_models": [],
+ "custom_models": [],
+ # Note: no edit_model
+ }
+ }
+
+ assert get_edit_model(config) == "openai/gpt-4o"
+
+ def test_get_models_with_legacy_openai_config(self) -> None:
+ """Test that the new get_*_model functions work with legacy open_ai.model config."""
+ config: AiConfig = {
+ "open_ai": {
+ "api_key": "test-key",
+ "model": "gpt-4-legacy",
+ }
+ }
+
+ # Should fall back to open_ai.model for both chat and edit
+ assert get_chat_model(config) == "gpt-4-legacy"
+ assert get_edit_model(config) == "gpt-4-legacy"
+ assert get_autocomplete_model({"ai": config}) == DEFAULT_MODEL
+
+ def test_for_model_with_autocomplete_model(self) -> None:
+ """Test AnyProviderConfig.for_model works with autocomplete models from new config."""
+ config: AiConfig = {
+ "open_ai": {"api_key": "test-key"},
+ "models": {
+ "autocomplete_model": "openai/gpt-3.5-turbo-instruct",
+ "displayed_models": [],
+ "custom_models": [],
+ },
+ }
+
+ provider_config = AnyProviderConfig.for_model(
+ "openai/gpt-3.5-turbo-instruct", config
+ )
+
+ assert provider_config.api_key == "test-key"
+ assert provider_config.tools == [] # Autocomplete should have no tools
+
class TestEdgeCases:
"""Tests for edge cases and error conditions."""
diff --git a/tests/_server/api/endpoints/test_ai.py b/tests/_server/api/endpoints/test_ai.py
index 48ad04aaaf..f0a658a362 100644
--- a/tests/_server/api/endpoints/test_ai.py
+++ b/tests/_server/api/endpoints/test_ai.py
@@ -311,9 +311,7 @@ class TestOpenAiEndpoints:
},
)
assert response.status_code == 400, response.text
- assert response.json() == {
- "detail": "AI completion API key not configured"
- }
+ assert response.json() == {"detail": "OpenAI API key not configured"}
@staticmethod
@with_session(SESSION_ID)
@@ -486,10 +484,9 @@ class TestGoogleAiEndpoints:
"ai": {
"open_ai": {"model": "gemini-1.5-pro"},
"google": {"api_key": "fake-key"},
- },
- "completion": {
- "model": "gemini-1.5-pro-for-inline-completion",
- "api_key": "fake-key",
+ "models": {
+ "autocomplete_model": "google/gemini-1.5-pro-for-inline-completion",
+ },
},
}
@@ -598,11 +595,10 @@ def _openai_config():
"open_ai": {
"api_key": "fake-api",
"model": "openai/some-openai-model",
- }
- },
- "completion": {
- "model": "gpt-marimo-for-inline-completion",
- "api_key": "fake-api",
+ },
+ "models": {
+ "autocomplete_model": "gpt-marimo-for-inline-completion",
+ },
},
}
@@ -613,11 +609,10 @@ def _openai_config_custom_model():
"open_ai": {
"api_key": "fake-api",
"model": "gpt-marimo",
- }
- },
- "completion": {
- "model": "gpt-marimo-for-inline-completion",
- "api_key": "fake-api",
+ },
+ "models": {
+ "autocomplete_model": "gpt-marimo-for-inline-completion",
+ },
},
}
@@ -629,22 +624,21 @@ def _openai_config_custom_base_url():
"api_key": "fake-api",
"base_url": "https://my-openai-instance.com",
"model": "openai/some-openai-model-with-base-url",
- }
- },
- "completion": {
- "model": "gpt-marimo-for-inline-completion",
- "api_key": "fake-api",
- "base_url": "https://my-openai-instance.com",
+ },
+ "models": {
+ "autocomplete_model": "gpt-marimo-for-inline-completion",
+ },
},
}
def _no_openai_config():
return {
- "ai": {"open_ai": {"api_key": "", "model": ""}},
- "completion": {
- "model": "gpt-marimo-for-inline-completion",
- "api_key": "",
+ "ai": {
+ "open_ai": {"api_key": "", "model": ""},
+ "models": {
+ "autocomplete_model": "gpt-marimo-for-inline-completion",
+ },
},
}
@@ -654,10 +648,9 @@ def _no_anthropic_config():
"ai": {
"open_ai": {"model": "claude-3.5"},
"anthropic": {"api_key": ""},
- },
- "completion": {
- "model": "claude-3.5-for-inline-completion",
- "api_key": "",
+ "models": {
+ "autocomplete_model": "claude-3.5-for-inline-completion",
+ },
},
}
@@ -667,10 +660,9 @@ def _anthropic_config():
"ai": {
"open_ai": {"model": "claude-3.5"},
"anthropic": {"api_key": "fake-key"},
- },
- "completion": {
- "model": "claude-3.5-for-inline-completion",
- "api_key": "fake-key",
+ "models": {
+ "autocomplete_model": "anthropic/claude-3.5-for-inline-completion",
+ },
},
}
@@ -680,10 +672,9 @@ def _google_ai_config():
"ai": {
"open_ai": {"model": "gemini-1.5-pro"},
"google": {"api_key": "fake-key"},
- },
- "completion": {
- "model": "gemini-1.5-pro-for-inline-completion",
- "api_key": "fake-key",
+ "models": {
+ "autocomplete_model": "google/gemini-1.5-pro-for-inline-completion",
+ },
},
}
diff --git a/tests/_server/api/endpoints/test_resume_session.py b/tests/_server/api/endpoints/test_resume_session.py
index 0d5004dfcb..c6f557e2c8 100644
--- a/tests/_server/api/endpoints/test_resume_session.py
+++ b/tests/_server/api/endpoints/test_resume_session.py
@@ -6,6 +6,8 @@ from contextlib import contextmanager
from dataclasses import asdict
from typing import TYPE_CHECKING, Any, Optional
+import pytest
+
from marimo._config.manager import UserConfigManager
from marimo._messaging.ops import CellOp, KernelCapabilities, KernelReady
from marimo._server.sessions import Session
@@ -291,6 +293,7 @@ def test_restart_session(client: TestClient) -> None:
client.post("/api/kernel/shutdown", headers=HEADERS)
def test_resume_session_with_watch(client: TestClient) -> None:
session_manager = get_session_manager(client)
session_manager.watch = True
diff --git a/tests/_server/templates/snapshots/export1.txt b/tests/_server/templates/snapshots/export1.txt
index 2ec18e4e2a..25530a6618 100644
--- a/tests/_server/templates/snapshots/export1.txt
+++ b/tests/_server/templates/snapshots/export1.txt
@@ -59,7 +59,7 @@
"mode": "read",
"version": "0.0.0",
"serverToken": "token",
- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
"configOverrides": {"formatting": {"line_length": 100}},
"appConfig": {"sql_output": "auto", "width": "compact"},
"view": {"showAppCode": true},
diff --git a/tests/_server/templates/snapshots/export2.txt b/tests/_server/templates/snapshots/export2.txt
index 4bf09ef228..253c5e77fc 100644
--- a/tests/_server/templates/snapshots/export2.txt
+++ b/tests/_server/templates/snapshots/export2.txt
@@ -59,7 +59,7 @@
"mode": "read",
"version": "0.0.0",
"serverToken": "token",
- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
"configOverrides": {"formatting": {"line_length": 100}},
"appConfig": {"sql_output": "auto", "width": "compact"},
"view": {"showAppCode": true},
diff --git a/tests/_server/templates/snapshots/export3.txt b/tests/_server/templates/snapshots/export3.txt
index f87e27b11f..0990b213b6 100644
--- a/tests/_server/templates/snapshots/export3.txt
+++ b/tests/_server/templates/snapshots/export3.txt
@@ -59,7 +59,7 @@
"mode": "read",
"version": "0.0.0",
"serverToken": "token",
- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
"configOverrides": {"formatting": {"line_length": 100}},
"appConfig": {"sql_output": "auto", "width": "compact"},
"view": {"showAppCode": true},
diff --git a/tests/_server/templates/snapshots/export4.txt b/tests/_server/templates/snapshots/export4.txt
index fa311cd89e..d79487114c 100644
--- a/tests/_server/templates/snapshots/export4.txt
+++ b/tests/_server/templates/snapshots/export4.txt
@@ -59,7 +59,7 @@
"mode": "read",
"version": "0.0.0",
"serverToken": "token",
- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
"configOverrides": {"formatting": {"line_length": 100}},
"appConfig": {"css_file": "custom.css", "sql_output": "auto", "width": "compact"},
"view": {"showAppCode": true},
diff --git a/tests/_server/templates/snapshots/export5.txt b/tests/_server/templates/snapshots/export5.txt
index a8ce29f377..66ee1a18da 100644
--- a/tests/_server/templates/snapshots/export5.txt
+++ b/tests/_server/templates/snapshots/export5.txt
@@ -59,7 +59,7 @@
"mode": "read",
"version": "0.0.0",
"serverToken": "token",
- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
"configOverrides": {"formatting": {"line_length": 100}},
"appConfig": {"app_title": "My App", "html_head_file": "head.html", "sql_output": "auto", "width": "compact"},
"view": {"showAppCode": true},
diff --git a/tests/_server/templates/snapshots/export6.txt b/tests/_server/templates/snapshots/export6.txt
index 104cfe7fa9..2dd52f94f9 100644
--- a/tests/_server/templates/snapshots/export6.txt
+++ b/tests/_server/templates/snapshots/export6.txt
@@ -59,7 +59,7 @@
"mode": "read",
"version": "0.0.0",
"serverToken": "token",
- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "custom_css": ["custom1.css", "custom2.css"], "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "custom_css": ["custom1.css", "custom2.css"], "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},
"configOverrides": {"formatting": {"line_length": 100}},
"appConfig": {"sql_output": "auto", "width": "compact"},
"view": {"showAppCode": true},