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.

add GitHub as a provider, add OpenAI models (#6044)

Myles Scolnick4b4de92997c2
diff --git a/frontend/src/components/ai/ai-model-dropdown.tsx b/frontend/src/components/ai/ai-model-dropdown.tsx
index f87e57f068..ddab129421 100644
--- a/frontend/src/components/ai/ai-model-dropdown.tsx
+++ b/frontend/src/components/ai/ai-model-dropdown.tsx
@@ -47,10 +47,6 @@ export const AIModelDropdown = ({
}: AIModelDropdownProps) => {
const currentValue = value ? AiModelId.parse(value) : undefined;
- const selectModel = (modelId: QualifiedModelId) => {
- onSelect(modelId);
- };
-
const [marimoConfig] = useResolvedMarimoConfig();
const configModels = marimoConfig.ai?.models;
@@ -148,7 +144,7 @@ export const AIModelDropdown = ({
<ProviderDropdownContent
key={provider}
provider={provider}
- onSelect={selectModel}
+ onSelect={onSelect}
models={models}
iconSizeClass={iconSizeClass}
/>
@@ -245,10 +241,6 @@ const ProviderDropdownContent = ({
onSelect={(e) => {
onSelect(qualifiedModelId);
}}
- onClick={(e) => {
- e.preventDefault();
- onSelect(qualifiedModelId);
- }}
>
<AiProviderIcon provider={iconProvider} className="h-4 w-4" />
<div className="pl-1 flex flex-col">
diff --git a/frontend/src/components/ai/ai-provider-icon.tsx b/frontend/src/components/ai/ai-provider-icon.tsx
index 581b7ef735..e740aa4664 100644
--- a/frontend/src/components/ai/ai-provider-icon.tsx
+++ b/frontend/src/components/ai/ai-provider-icon.tsx
@@ -4,6 +4,7 @@ import AnthropicIcon from "@marimo-team/llm-info/icons/anthropic.svg?inline";
import BedrockIcon from "@marimo-team/llm-info/icons/aws.svg?inline";
import AzureIcon from "@marimo-team/llm-info/icons/azure.svg?inline";
import DeepseekIcon from "@marimo-team/llm-info/icons/deepseek.svg?inline";
+import GitHubIcon from "@marimo-team/llm-info/icons/github.svg?inline";
import GeminiIcon from "@marimo-team/llm-info/icons/googlegemini.svg?inline";
import OllamaIcon from "@marimo-team/llm-info/icons/ollama.svg?inline";
import OpenAIIcon from "@marimo-team/llm-info/icons/openai.svg?inline";
@@ -20,6 +21,7 @@ const icons: Record<ProviderId, string> = {
azure: AzureIcon,
bedrock: BedrockIcon,
deepseek: DeepseekIcon,
+ github: GitHubIcon,
};
export interface AiProviderIconProps
diff --git a/frontend/src/components/app-config/ai-config.tsx b/frontend/src/components/app-config/ai-config.tsx
index 9d389ff750..d2e43f50c2 100644
--- a/frontend/src/components/app-config/ai-config.tsx
+++ b/frontend/src/components/app-config/ai-config.tsx
@@ -333,11 +333,15 @@ export const ProviderSelect: React.FC<ProviderSelectProps> = ({
);
};
-const renderCopilotProvider = (
- form: UseFormReturn<UserConfig>,
- onSubmit: (values: UserConfig) => Promise<void>,
- config: UserConfig,
-) => {
+const renderCopilotProvider = ({
+ form,
+ config,
+ onSubmit,
+}: {
+ form: UseFormReturn<UserConfig>;
+ config: UserConfig;
+ onSubmit: (values: UserConfig) => Promise<void>;
+}) => {
const copilot = form.getValues("completion.copilot");
if (copilot === false) {
return null;
@@ -409,7 +413,7 @@ export const AiCodeCompletionConfig: React.FC<AiConfigProps> = ({
testId="copilot-select"
/>
- {renderCopilotProvider(form, onSubmit, config)}
+ {renderCopilotProvider({ form, config, onSubmit })}
</SettingGroup>
);
};
@@ -419,16 +423,25 @@ const AccordionFormItem = ({
triggerClassName,
provider,
children,
+ isConfigured,
}: {
title: string;
triggerClassName?: string;
provider: AiProviderIconProps["provider"];
children: React.ReactNode;
+ isConfigured: boolean;
}) => {
return (
<AccordionItem value={provider}>
<AccordionTrigger className={triggerClassName}>
- <AiProviderTitle provider={provider}>{title}</AiProviderTitle>
+ <AiProviderTitle provider={provider}>
+ {title}
+ {isConfigured && (
+ <span className="ml-2 px-1 rounded bg-muted text-xs font-medium border">
+ Configured
+ </span>
+ )}
+ </AiProviderTitle>
</AccordionTrigger>
<AccordionContent wrapperClassName="flex flex-col gap-4">
{children}
@@ -443,6 +456,10 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
}) => {
const isWasmRuntime = isWasm();
+ const hasValue = (name: FieldPath<UserConfig>) => {
+ return !!form.getValues(name);
+ };
+
return (
<SettingGroup>
<p className="text-sm text-muted-secondary">
@@ -458,6 +475,7 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
title="OpenAI"
provider="openai"
triggerClassName="pt-0"
+ isConfigured={hasValue("ai.open_ai.api_key")}
>
<ApiKey
form={form}
@@ -485,7 +503,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
/>
</AccordionFormItem>
- <AccordionFormItem title="Anthropic" provider="anthropic">
+ <AccordionFormItem
+ title="Anthropic"
+ provider="anthropic"
+ isConfigured={hasValue("ai.anthropic.api_key")}
+ >
<ApiKey
form={form}
config={config}
@@ -504,7 +526,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
/>
</AccordionFormItem>
- <AccordionFormItem title="Google" provider="google">
+ <AccordionFormItem
+ title="Google"
+ provider="google"
+ isConfigured={hasValue("ai.google.api_key")}
+ >
<ApiKey
form={form}
config={config}
@@ -523,7 +549,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
/>
</AccordionFormItem>
- <AccordionFormItem title="Ollama" provider="ollama">
+ <AccordionFormItem
+ title="Ollama"
+ provider="ollama"
+ isConfigured={hasValue("ai.ollama.base_url")}
+ >
<BaseUrl
form={form}
config={config}
@@ -534,7 +564,40 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
/>
</AccordionFormItem>
- <AccordionFormItem title="Azure" provider="azure">
+ <AccordionFormItem
+ title="GitHub"
+ provider="github"
+ isConfigured={hasValue("ai.github.api_key")}
+ >
+ <ApiKey
+ form={form}
+ config={config}
+ name="ai.github.api_key"
+ placeholder="ghp_..."
+ testId="ai-github-api-key-input"
+ description={
+ <>
+ Your GitHub API token from{" "}
+ <Kbd className="inline">gh auth token</Kbd>.
+ </>
+ }
+ />
+ <BaseUrl
+ form={form}
+ config={config}
+ name="ai.github.base_url"
+ placeholder="https://api.githubcopilot.com/"
+ testId="ai-github-base-url-input"
+ />
+ </AccordionFormItem>
+
+ <AccordionFormItem
+ title="Azure"
+ provider="azure"
+ isConfigured={
+ hasValue("ai.azure.api_key") && hasValue("ai.azure.base_url")
+ }
+ >
<ApiKey
form={form}
config={config}
@@ -560,7 +623,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
/>
</AccordionFormItem>
- <AccordionFormItem title="AWS Bedrock" provider="bedrock">
+ <AccordionFormItem
+ title="AWS Bedrock"
+ provider="bedrock"
+ isConfigured={hasValue("ai.bedrock.region_name")}
+ >
<p className="text-sm text-muted-secondary mb-2">
To use AWS Bedrock, you need to configure AWS credentials and
region. See the{" "}
@@ -646,6 +713,10 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
<AccordionFormItem
title="OpenAI-Compatible"
provider="openai-compatible"
+ isConfigured={
+ hasValue("ai.open_ai_compatible.api_key") &&
+ hasValue("ai.open_ai_compatible.base_url")
+ }
>
<ApiKey
form={form}
diff --git a/frontend/src/core/ai/ids/__tests__/ids.test.ts b/frontend/src/core/ai/ids/__tests__/ids.test.ts
index 8ff8683f11..653df733d0 100644
--- a/frontend/src/core/ai/ids/__tests__/ids.test.ts
+++ b/frontend/src/core/ai/ids/__tests__/ids.test.ts
@@ -26,6 +26,7 @@ describe("AiModelId", () => {
"google",
"ollama",
"bedrock",
+ "github",
];
providers.forEach((provider) => {
@@ -67,6 +68,12 @@ describe("AiModelId", () => {
expect(modelId.shortModelId).toBe("titan-text");
});
+ it("should parse github qualified id", () => {
+ const modelId = AiModelId.parse("github/gpt-4o");
+ expect(modelId.providerId).toBe("github");
+ expect(modelId.shortModelId).toBe("gpt-4o");
+ });
+
it("should handle multiple slashes", () => {
const modelId = AiModelId.parse("openai/gpt-4/turbo");
expect(modelId.providerId).toBe("openai");
@@ -171,6 +178,7 @@ describe("AiModelId", () => {
"google",
"ollama",
"bedrock",
+ "github",
];
providers.forEach((provider) => {
diff --git a/frontend/src/core/ai/ids/ids.ts b/frontend/src/core/ai/ids/ids.ts
index 660aee3b6e..65f719cbff 100644
--- a/frontend/src/core/ai/ids/ids.ts
+++ b/frontend/src/core/ai/ids/ids.ts
@@ -10,6 +10,7 @@ export const PROVIDERS = [
"bedrock",
"deepseek",
"azure",
+ "github",
] as const;
export type ProviderId = (typeof PROVIDERS)[number];
diff --git a/marimo/_cli/development/commands.py b/marimo/_cli/development/commands.py
index 625a55ff8c..abc0908e43 100644
--- a/marimo/_cli/development/commands.py
+++ b/marimo/_cli/development/commands.py
@@ -63,6 +63,7 @@ def _generate_server_api_schema() -> dict[str, Any]:
CellConfig,
config.OpenAiConfig,
config.AnthropicConfig,
+ config.GitHubConfig,
config.GoogleAiConfig,
config.BedrockConfig,
config.AiConfig,
diff --git a/marimo/_config/config.py b/marimo/_config/config.py
index 61ef825366..4a4ea1be30 100644
--- a/marimo/_config/config.py
+++ b/marimo/_config/config.py
@@ -268,6 +268,7 @@ class AiConfig(TypedDict, total=False):
- `bedrock`: the Bedrock config
- `azure`: the Azure config
- `ollama`: the Ollama config
+ - `github`: the GitHub config
- `open_ai_compatible`: the OpenAI-compatible config
"""
@@ -283,6 +284,7 @@ class AiConfig(TypedDict, total=False):
bedrock: BedrockConfig
azure: OpenAiConfig
ollama: OpenAiConfig
+ github: GitHubConfig
open_ai_compatible: OpenAiConfig
@@ -351,6 +353,20 @@ class BedrockConfig(TypedDict, total=False):
aws_secret_access_key: NotRequired[str]
+@dataclass
+class GitHubConfig(TypedDict, total=False):
+ """Configuration options for GitHub.
+
+ **Keys.**
+
+ - `api_key`: the GitHub API token
+ - `base_url`: the base URL for the API
+ """
+
+ api_key: str
+ base_url: NotRequired[str]
+
+
@dataclass
class PythonLanguageServerConfig(TypedDict, total=False):
"""
diff --git a/marimo/_server/ai/config.py b/marimo/_server/ai/config.py
index 5311f459b2..c34964920d 100644
--- a/marimo/_server/ai/config.py
+++ b/marimo/_server/ai/config.py
@@ -57,7 +57,24 @@ class AnyProviderConfig:
@classmethod
def for_ollama(cls, config: AiConfig) -> AnyProviderConfig:
return cls._for_openai_like(
- config, "ollama", "Ollama", fallback_key="ollama-placeholder"
+ config,
+ "ollama",
+ "Ollama",
+ fallback_key="ollama-placeholder",
+ # Default base URL for Ollama
+ fallback_base_url="http://127.0.0.1:11434/v1",
+ )
+
+ @classmethod
+ def for_github(cls, config: AiConfig) -> AnyProviderConfig:
+ fallback_key = cls.os_key("GITHUB_TOKEN")
+ return cls._for_openai_like(
+ config,
+ "github",
+ "GitHub",
+ fallback_key=fallback_key,
+ # Default base URL for GitHub Copilot
+ fallback_base_url="https://api.githubcopilot.com/",
)
@classmethod
@@ -68,12 +85,13 @@ class AnyProviderConfig:
name: str,
*,
fallback_key: Optional[str] = None,
+ fallback_base_url: Optional[str] = None,
) -> AnyProviderConfig:
ai_config = _get_ai_config(config, key, name)
key = _get_key(ai_config, name, fallback_key=fallback_key)
kwargs: dict[str, Any] = {
- "base_url": _get_base_url(ai_config),
+ "base_url": _get_base_url(ai_config) or fallback_base_url,
"api_key": key,
"ssl_verify": ai_config.get("ssl_verify", True),
"ca_bundle_path": ai_config.get("ca_bundle_path", None),
@@ -145,6 +163,8 @@ class AnyProviderConfig:
return cls.for_openai(config)
elif model_id.provider == "azure":
return cls.for_azure(config)
+ elif model_id.provider == "github":
+ return cls.for_github(config)
elif model_id.provider == "openai_compatible":
return cls.for_openai_compatible(config)
else:
diff --git a/marimo/_smoke_tests/ai/github_model_check.py b/marimo/_smoke_tests/ai/github_model_check.py
new file mode 100644
index 0000000000..33243035f4
--- /dev/null
+++ b/marimo/_smoke_tests/ai/github_model_check.py
@@ -0,0 +1,77 @@
+# /// script
+# dependencies = [
+# "marimo",
+# "openai==1.99.9",
+# ]
+# [tool.marimo.runtime]
+# auto_instantiate = false
+# ///
+
+import marimo
+
+__generated_with = "0.14.16"
+app = marimo.App(width="medium")
+
+
+def _():
+ import marimo as mo
+ import openai
+ import os
+ return mo, openai
+
+
+def _(mo):
+ # Set up OpenAI API key
+ api_key = mo.ui.text(
+ value="", label="GitHub API Key. Use `gh auth token`", full_width=True
+ )
+ api_key
+ return (api_key,)
+
+
+def _(api_key, openai):
+ client = openai.Client(
+ base_url="https://api.githubcopilot.com/",
+ api_key=api_key.value,
+ )
+ models = client.models.list().model_dump()
+ return client, models
+
+
+def _(models):
+ ids = [item["id"] for item in models["data"]]
+ ids
+ return (ids,)
+
+
+def _(mo):
+ # Button to trigger API call
+ run_button = mo.ui.run_button(label="Generate Response")
+ run_button
+ return (run_button,)
+
+
+def _(client, ids, run_button):
+ if run_button.value:
+ for model in ids:
+ try:
+ response = client.chat.completions.create(
+ model=model,
+ messages=[{"role": "user", "content": "hi"}],
+ max_tokens=100,
+ )
+ print("✅ Model " + model + " passed: ")
+ print(response.choices[0].message.content)
+ except:
+ print("❌ Model " + model + " failed")
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/ai/model_check.py b/marimo/_smoke_tests/ai/model_check.py
new file mode 100644
index 0000000000..c4e4da04ff
--- /dev/null
+++ b/marimo/_smoke_tests/ai/model_check.py
@@ -0,0 +1,179 @@
+# /// script
+# requires-python = ">=3.12"
+# dependencies = [
+# "anthropic==0.64.0",
+# "any-llm-sdk[anthropic]==0.12.1",
+# "google-genai==1.30.0",
+# "marimo",
+# "polars==1.32.3",
+# "protobuf==5.29.5",
+# ]
+# ///
+
+import marimo
+
+__generated_with = "0.14.17"
+app = marimo.App(width="medium")
+
+
[email protected](hide_code=True)
+def _():
+ models_csv = """
+ name,model,description,provider,roles,thinking
+ Claude 3 Haiku,claude-3-haiku-20240307,Fastest model optimized for speed and efficiency,anthropic,"chat, edit",False
+ Claude 3.5 Haiku,claude-3-5-haiku-20241022,Fast and efficient model with excellent performance for everyday tasks,anthropic,"chat, edit",False
+ Claude 3.5 Sonnet v2,claude-3-5-sonnet-20241022,High-performance model with advanced coding and reasoning capabilities,anthropic,"chat, edit, code, vision",False
+ Claude Opus 4,claude-opus-4-20250514,World's best coding model with sustained performance on complex tasks,anthropic,"chat, edit, code, reasoning, vision",True
+ Claude Opus 4.1,claude-opus-4-1-20250805,Latest flagship model with hybrid reasoning capabilities,anthropic,"chat, edit, reasoning, vision",True
+ Claude Sonnet 3.7,claude-3-7-sonnet-20250219,Hybrid AI reasoning model with rapid or thoughtful responses,anthropic,"chat, edit, reasoning, vision",True
+ Claude Sonnet 4,claude-sonnet-4-20250514,Superior coding and reasoning while responding precisely to instructions,anthropic,"chat, edit, code, reasoning, vision",True
+ GPT-4.1,gpt-4.1,"Fast, highly intelligent model with largest context window",azure,"chat, edit, code",False
+ GPT-4o,gpt-4o,"Fast, intelligent, flexible GPT model with multimodal capabilities",azure,"chat, edit, vision",False
+ GPT-5,gpt-5,The best model for coding and agentic tasks across domains,azure,"chat, edit, code, agent",False
+ GPT-5 Mini,gpt-5-mini,"A faster, cost-efficient version of GPT-5 for well-defined tasks",azure,"chat, edit",False
+ o1-mini,o1-mini,Faster and cheaper reasoning model,azure,"reasoning, math",True
+ o1-preview,o1-preview,Reasoning model with advanced problem solving capabilities,azure,"reasoning, math, code",True
+ Amazon Nova Lite,amazon.nova-lite-v1:0,Fast and cost-effective multimodal model,bedrock,"chat, edit, vision",False
+ Amazon Nova Micro,amazon.nova-micro-v1:0,Ultra-fast text-only model for simple tasks,bedrock,"chat, edit",False
+ Amazon Nova Premier,amazon.nova-premier-v1:0,High-performance multimodal model for complex reasoning tasks,bedrock,"chat, edit, vision, reasoning",False
+ Amazon Nova Pro,amazon.nova-pro-v1:0,Balanced multimodal model for general-purpose applications,bedrock,"chat, edit, vision",False
+ Claude 3.5 Haiku,anthropic.claude-3-5-haiku-20241022-v1:0,Fast and efficient model for everyday tasks,bedrock,"chat, edit",False
+ Claude 3.5 Sonnet v2,anthropic.claude-3-5-sonnet-20241022-v1:0,High-performance model with advanced coding capabilities,bedrock,"chat, edit, code, vision",False
+ Claude Opus 4.1,anthropic.claude-opus-4-1-20250805-v1:0,Latest flagship model with hybrid reasoning capabilities,bedrock,"chat, edit, reasoning, vision",True
+ Claude Sonnet 3.7,us.anthropic.claude-3-7-sonnet-20250219-v1:0,Hybrid reasoning model with rapid or thoughtful responses (uses inference profile),bedrock,"chat, edit, reasoning, vision",True
+ Claude Sonnet 4,anthropic.claude-sonnet-4-20250514-v1:0,Superior coding and reasoning model,bedrock,"chat, edit, code, reasoning, vision",True
+ DeepSeek R1,deepseek.deepseek-r1-671b-instruct-v1:0,Advanced reasoning model with step-by-step thinking,bedrock,"reasoning, math, code",True
+ Meta Llama 3.2 90B Vision,meta.llama3-2-90b-instruct-v1:0,Large multimodal model with vision capabilities,bedrock,"chat, edit, vision",False
+ Meta Llama 3.3 70B,meta.llama3-3-70b-instruct-v1:0,Latest Meta model with improved capabilities,bedrock,"chat, edit, code",False
+ Gemini 1.5 Flash,gemini-1.5-flash,Fast and cost-effective model for high-volume applications,google,"chat, edit",False
+ Gemini 1.5 Pro,gemini-1.5-pro,Advanced multimodal model with extensive context understanding,google,"chat, edit, vision, code",False
+ Gemini 2.0 Flash,gemini-2.0-flash,"Next generation features, speed, and realtime streaming",google,"chat, edit, vision, code",False
+ Gemini 2.5 Flash,gemini-2.5-flash,Efficient workhorse model with controllable thinking budget,google,"chat, edit, reasoning",True
+ Gemini 2.5 Flash-Lite,gemini-2.5-flash-lite,Most cost-efficient model supporting high throughput,google,"chat, edit",False
+ Gemini 2.5 Pro,gemini-2.5-pro,Most intelligent and capable AI model with 1M token context window,google,"chat, edit, reasoning, vision, code",True
+ Codellama 34B,codellama:34b,Specialized model optimized for code generation and programming,ollama,"code, edit",False
+ DeepSeek R1 70B,deepseek-r1:70b,Open reasoning model with performance approaching leading models,ollama,"reasoning, math, code",True
+ DeepSeek R1 7B,deepseek-r1:7b,Smaller reasoning model with step-by-step thinking,ollama,"reasoning, math",True
+ Gemma 3 27B,gemma3:27b,"Current, most capable Google model that runs on a single GPU",ollama,"chat, edit, code, vision",False
+ Llama 3.1 70B,llama3.1:70b,State-of-the-art model from Meta with 70B parameters,ollama,"chat, edit, code",False
+ Llama 3.2 Vision 11B,llama3.2-vision:11b,Multimodal model with vision capabilities,ollama,"chat, edit, vision",False
+ Llama 3.2 Vision 90B,llama3.2-vision:90b,Large multimodal model with advanced vision understanding,ollama,"chat, edit, vision",False
+ Llava 34B,llava:34b,Advanced vision-language understanding model,ollama,"chat, vision",False
+ Mistral 7B,mistral:7b,Efficient and powerful model for general-purpose tasks,ollama,"chat, edit",False
+ Qwen 3 32B,qwen3:32b,Latest generation model with dense and MoE architectures,ollama,"chat, edit, code",True
+ gpt-oss 120B,gpt-oss:120b,Most powerful open-weight model from OpenAI with agentic capabilities,ollama,"chat, reasoning, agent, code",True
+ gpt-oss 20B,gpt-oss:20b,Medium-sized open-weight model for low latency tasks,ollama,"chat, agent",True
+ GPT-4.1,gpt-4.1,"Fast, highly intelligent model with largest context window (1 million tokens)",openai,"chat, edit, code",False
+ GPT-4.1 Mini,gpt-4.1-mini,"Balanced for intelligence, speed, and cost",openai,"chat, edit",False
+ GPT-4o,gpt-4o,"Fast, intelligent, flexible GPT model with multimodal capabilities",openai,"chat, edit, vision",False
+ GPT-4o Mini,gpt-4o-mini,"Fast, affordable small model for focused tasks",openai,"chat, edit",False
+ GPT-5,gpt-5,The best model for coding and agentic tasks across domains,openai,"chat, edit, code, agent",False
+ GPT-5 Mini,gpt-5-mini,"A faster, cost-efficient version of GPT-5 for well-defined tasks",openai,"chat, edit",False
+ GPT-5 Nano,gpt-5-nano,"Fastest, most cost-efficient version of GPT-5",openai,"chat, edit",False
+ o3,o3,Our most powerful reasoning model with chain-of-thought capabilities,openai,"reasoning, math, code",True
+ o3-mini,o3-mini,A small model alternative to o3 for reasoning tasks,openai,"reasoning, math",True
+ o3-pro,o3-pro,Version of o3 designed to think longer and provide most reliable responses,openai,"reasoning, math, code",True
+ o4-mini,o4-mini,"Faster, more affordable reasoning model optimized for math, coding, and visual tasks",openai,"reasoning, code, vision",True
+ """
+ return (models_csv,)
+
+
+def _(models_csv):
+ import polars as pl
+ import io
+
+ df = pl.read_csv(io.BytesIO(models_csv.encode()))
+ df
+ return (df,)
+
+
+def _():
+ import any_llm
+ import marimo as mo
+ import anthropic
+ return any_llm, mo
+
+
+def get_key(provider):
+ from marimo._config.manager import get_default_config_manager
+
+ config = get_default_config_manager(current_path=None).get_config(
+ hide_secrets=False
+ )["ai"]
+ if provider == "openai":
+ return config.get("open_ai", {}).get("api_key")
+ return config.get(provider, {}).get("api_key")
+
+
+def _(any_llm, mo):
+ @mo.persistent_cache()
+ def query(provider, model):
+ key = get_key(provider)
+ return any_llm.completion(
+ model=f"{provider}/{model}",
+ messages=[{"role": "user", "content": "hi"}],
+ api_key=key,
+ )
+ return (query,)
+
+
+def _(df, query):
+ SKIP = {"azure", "bedrock", "ollama"}
+
+ for record in df.to_dicts():
+ provider = record["provider"]
+ if provider in SKIP:
+ continue
+ model = record["model"]
+ print(f"Testing {provider} / {model}")
+ try:
+ res = query(provider, model)
+ print(f"✅ {provider} / {model}")
+ print(res.choices[0].message.content)
+ except Exception as e:
+ print(f"❌ {e}")
+ return
+
+
+def _(query):
+ others = [
+ ["google", "codegemma"],
+ ["google", "codegemma-2b"],
+ ["google", "codegemma-7b"],
+ ]
+
+ for provider, model in others:
+ print(f"Testing {provider} / {model}")
+ try:
+ res = query(provider, model)
+ print(f"✅ {provider} / {model}")
+ print(res.choices[0].message.content)
+ except Exception as e:
+ print(f"❌ {e}")
+ return
+
+
+def _():
+ import google.genai as genai
+
+ client = genai.Client(api_key=get_key("google"))
+
+ for m in client.models.list():
+ for action in m.supported_actions:
+ if action == "generateContent":
+ print(f"Model name: {m.name}")
+ print(f"Display name: {m.display_name}")
+ print(f"Description: {m.description}")
+ print("-" * 80)
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/packages/llm-info/data/models.yml b/packages/llm-info/data/models.yml
index 3037836ccf..17ccb4ec77 100644
--- a/packages/llm-info/data/models.yml
+++ b/packages/llm-info/data/models.yml
@@ -116,6 +116,96 @@
roles: [chat, edit]
thinking: false
+# OpenAI
+
+- name: GPT-4.1
+ model: gpt-4.1
+ description: Fast, highly intelligent model with largest context window (1 million tokens)
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: false
+
+- name: GPT-4.1 Mini
+ model: gpt-4.1-mini
+ description: Balanced for intelligence, speed, and cost
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: false
+
+- name: GPT-4o
+ model: gpt-4o
+ description: Fast, intelligent, flexible GPT model with multimodal capabilities
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: false
+
+- name: GPT-4o Mini
+ model: gpt-4o-mini
+ description: Fast, affordable small model for focused tasks
+ providers: [openai, github]
+ roles: [chat, edit]
+ thinking: false
+
+- name: GPT-5
+ model: gpt-5
+ description: The best model for coding and agentic tasks across domains
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: false
+
+- name: GPT-5 Mini
+ model: gpt-5-mini
+ description: A faster, cost-efficient version of GPT-5 for well-defined tasks
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: false
+
+- name: GPT-5 Nano
+ model: gpt-5-nano
+ description: Fastest, most cost-efficient version of GPT-5
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: false
+
+- name: o3
+ model: o3
+ description: Our most powerful reasoning model with chain-of-thought capabilities
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: true
+
+- name: o3 Mini
+ model: o3-mini
+ description: A small model alternative to o3 for reasoning tasks
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: true
+
+- name: o3 Pro
+ model: o3-pro
+ description: Version of o3 designed to think longer and provide most reliable responses
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: true
+
+- name: o4 Mini
+ model: o4-mini
+ description: Faster, more affordable reasoning model optimized for math, coding, and visual tasks
+ providers: [openai]
+ roles: [chat, edit]
+ thinking: true
+
+
+# GitHub
+
+- name: GPT-3.5-turbo
+ model: gpt-3.5-turbo
+ description: Fast and efficient model with excellent performance for everyday tasks
+ providers: [github]
+ roles: [chat, edit]
+ thinking: false
+
+
# Bedrock
- name: Claude 3.5 Haiku (Bedrock)
@@ -301,3 +391,4 @@
providers: [ollama]
roles: [chat]
thinking: false
+
diff --git a/packages/llm-info/data/providers.yml b/packages/llm-info/data/providers.yml
index 725432113a..c4cbbe06ba 100644
--- a/packages/llm-info/data/providers.yml
+++ b/packages/llm-info/data/providers.yml
@@ -27,3 +27,8 @@
id: ollama
description: Ollama is a lightweight, open-source model server for running and sharing LLMs.
url: https://ollama.ai/
+
+- name: GitHub
+ id: github
+ description: GitHub's API for GPT models with GitHub-hosted models.
+ url: https://github.com/features/copilot
diff --git a/packages/llm-info/icons/github.svg b/packages/llm-info/icons/github.svg
new file mode 100644
index 0000000000..538ec5bf2a
--- /dev/null
+++ b/packages/llm-info/icons/github.svg
@@ -0,0 +1 @@
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
\ No newline at end of file
diff --git a/packages/openapi/api.yaml b/packages/openapi/api.yaml
index dfb2d63b58..f6283bdd7d 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:
@@ -60,14 +60,16 @@ components:
$ref: '#/components/schemas/OpenAiConfig'
bedrock:
$ref: '#/components/schemas/BedrockConfig'
+ github:
+ $ref: '#/components/schemas/GitHubConfig'
google:
$ref: '#/components/schemas/GoogleAiConfig'
max_tokens:
type: integer
mode:
enum:
- - ask
- - manual
+ - ask
+ - manual
type: string
models:
properties:
@@ -79,15 +81,15 @@ components:
items:
type: string
type: array
- edit_model:
- type: string
displayed_models:
items:
type: string
type: array
+ edit_model:
+ type: string
required:
- - displayed_models
- - custom_models
+ - displayed_models
+ - custom_models
type: object
ollama:
$ref: '#/components/schemas/OpenAiConfig'
@@ -102,18 +104,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:
@@ -121,19 +123,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:
@@ -144,33 +146,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:
@@ -185,13 +187,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:
@@ -203,8 +205,8 @@ components:
hide_code:
type: boolean
required:
- - disabled
- - hide_code
+ - disabled
+ - hide_code
type: object
CellOp:
properties:
@@ -213,13 +215,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'
@@ -239,9 +241,9 @@ components:
timestamp:
type: number
required:
- - cell_id
- - timestamp
- - name
+ - cell_id
+ - timestamp
+ - name
type: object
CellOutput:
properties:
@@ -249,21 +251,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:
@@ -285,8 +287,8 @@ components:
url:
type: string
required:
- - url
- - name
+ - url
+ - name
type: object
nullable: true
type: array
@@ -296,90 +298,90 @@ components:
parts:
items:
oneOf:
- - properties:
- text:
- type: string
- type:
- enum:
- - text
- type: string
- required:
- - type
+ - properties:
+ text:
+ type: string
+ type:
+ enum:
- text
- 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:
+ type: string
+ required:
+ - type
+ - text
+ type: object
+ - properties:
+ details:
+ items:
properties:
- args:
- additionalProperties: {}
- type: object
- result: {}
- state:
- enum:
- - result
+ signature:
+ nullable: true
type: string
- step:
- type: integer
- toolCallId:
+ text:
type: string
- toolName:
+ type:
+ enum:
+ - text
type: string
required:
- - state
- - result
- - toolCallId
- - toolName
- - step
- - args
+ - type
+ - text
type: object
- type:
- enum:
- - tool-invocation
- type: string
- required:
- - type
- - toolInvocation
- 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:
+ - 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
nullable: true
type: array
role:
enum:
- - user
- - assistant
- - system
+ - user
+ - assistant
+ - system
type: string
required:
- - role
- - content
+ - role
+ - content
type: object
type: array
model:
@@ -388,14 +390,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:
@@ -406,9 +408,9 @@ components:
id:
type: string
required:
- - id
- - document
- - cellId
+ - id
+ - document
+ - cellId
type: object
ColumnStats:
properties:
@@ -459,10 +461,10 @@ components:
properties:
name:
enum:
- - completed-run
+ - completed-run
type: string
required:
- - name
+ - name
type: object
CompletionResult:
properties:
@@ -470,7 +472,7 @@ components:
type: string
name:
enum:
- - completion-result
+ - completion-result
type: string
options:
items:
@@ -483,17 +485,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:
@@ -502,8 +504,8 @@ components:
source:
type: string
required:
- - source
- - destination
+ - source
+ - destination
type: object
CreateSecretRequest:
properties:
@@ -513,36 +515,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:
@@ -564,7 +566,7 @@ components:
type: array
name:
enum:
- - data-column-preview
+ - data-column-preview
type: string
stats:
$ref: '#/components/schemas/ColumnStats'
@@ -572,9 +574,9 @@ components:
table_name:
type: string
required:
- - table_name
- - column_name
- - name
+ - table_name
+ - column_name
+ - name
type: object
DataSourceConnection:
properties:
@@ -598,14 +600,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:
@@ -623,11 +625,11 @@ components:
source:
type: string
required:
- - source
- - dialect
- - name
- - display_name
- - databases
+ - source
+ - dialect
+ - name
+ - display_name
+ - databases
type: object
DataSourceConnections:
properties:
@@ -637,11 +639,11 @@ components:
type: array
name:
enum:
- - data-source-connections
+ - data-source-connections
type: string
required:
- - connections
- - name
+ - connections
+ - name
type: object
DataTable:
properties:
@@ -674,25 +676,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:
@@ -706,21 +708,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:
@@ -736,45 +738,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:
@@ -794,9 +796,9 @@ components:
nullable: true
type: string
required:
- - name
- - tags
- - dependencies
+ - name
+ - tags
+ - dependencies
type: object
DependencyTreeResponse:
properties:
@@ -806,18 +808,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:
@@ -834,9 +836,9 @@ components:
timestamp:
type: number
required:
- - cellIds
- - codes
- - timestamp
+ - cellIds
+ - codes
+ - timestamp
type: object
ExecuteScratchpadRequest:
properties:
@@ -846,7 +848,7 @@ components:
$ref: '#/components/schemas/HTTPRequest'
nullable: true
required:
- - code
+ - code
type: object
ExecuteStaleRequest:
properties:
@@ -866,9 +868,9 @@ components:
timestamp:
type: number
required:
- - cellId
- - code
- - timestamp
+ - cellId
+ - code
+ - timestamp
type: object
ExportAsHTMLRequest:
properties:
@@ -884,30 +886,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:
@@ -920,13 +922,13 @@ components:
type: string
type:
enum:
- - file
- - directory
+ - file
+ - directory
type: string
required:
- - path
- - type
- - name
+ - path
+ - type
+ - name
type: object
FileCreateResponse:
properties:
@@ -939,14 +941,14 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FileDeleteRequest:
properties:
path:
type: string
required:
- - path
+ - path
type: object
FileDeleteResponse:
properties:
@@ -956,14 +958,14 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FileDetailsRequest:
properties:
path:
type: string
required:
- - path
+ - path
type: object
FileDetailsResponse:
properties:
@@ -976,7 +978,7 @@ components:
nullable: true
type: string
required:
- - file
+ - file
type: object
FileInfo:
properties:
@@ -998,12 +1000,12 @@ components:
path:
type: string
required:
- - id
- - path
- - name
- - isDirectory
- - isMarimoFile
- - children
+ - id
+ - path
+ - name
+ - isDirectory
+ - isMarimoFile
+ - children
type: object
FileListRequest:
properties:
@@ -1020,8 +1022,8 @@ components:
root:
type: string
required:
- - files
- - root
+ - files
+ - root
type: object
FileMoveRequest:
properties:
@@ -1030,8 +1032,8 @@ components:
path:
type: string
required:
- - path
- - newPath
+ - path
+ - newPath
type: object
FileMoveResponse:
properties:
@@ -1044,14 +1046,14 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FileOpenRequest:
properties:
path:
type: string
required:
- - path
+ - path
type: object
FileUpdateRequest:
properties:
@@ -1060,8 +1062,8 @@ components:
path:
type: string
required:
- - path
- - contents
+ - path
+ - contents
type: object
FileUpdateResponse:
properties:
@@ -1074,7 +1076,7 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
FocusCell:
properties:
@@ -1082,11 +1084,11 @@ components:
type: string
name:
enum:
- - focus-cell
+ - focus-cell
type: string
required:
- - cell_id
- - name
+ - cell_id
+ - name
type: object
FormatRequest:
properties:
@@ -1097,8 +1099,8 @@ components:
lineLength:
type: integer
required:
- - codes
- - lineLength
+ - codes
+ - lineLength
type: object
FormatResponse:
properties:
@@ -1107,7 +1109,7 @@ components:
type: string
type: object
required:
- - codes
+ - codes
type: object
FunctionCallRequest:
properties:
@@ -1121,10 +1123,10 @@ components:
namespace:
type: string
required:
- - functionCallId
- - namespace
- - functionName
- - args
+ - functionCallId
+ - namespace
+ - functionName
+ - args
type: object
FunctionCallResult:
properties:
@@ -1132,30 +1134,37 @@ 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
+ GitHubConfig:
+ properties:
+ api_key:
+ type: string
+ base_url:
+ type: string
type: object
GoogleAiConfig:
properties:
@@ -1168,8 +1177,8 @@ components:
properties:
code:
enum:
- - ok
- - error
+ - ok
+ - error
type: string
message:
nullable: true
@@ -1178,7 +1187,7 @@ components:
nullable: true
type: string
required:
- - code
+ - code
type: object
ImportStarError:
properties:
@@ -1186,11 +1195,11 @@ components:
type: string
type:
enum:
- - import-star
+ - import-star
type: string
required:
- - msg
- - type
+ - msg
+ - type
type: object
InstallMissingPackagesRequest:
properties:
@@ -1201,27 +1210,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:
@@ -1235,18 +1244,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:
@@ -1256,8 +1265,8 @@ components:
toolName:
type: string
required:
- - toolName
- - arguments
+ - toolName
+ - arguments
type: object
InvokeAiToolResponse:
properties:
@@ -1270,18 +1279,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:
@@ -1292,9 +1301,9 @@ components:
auto_download:
items:
enum:
- - html
- - markdown
- - ipynb
+ - html
+ - markdown
+ - ipynb
type: string
type: array
css_file:
@@ -1308,24 +1317,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:
@@ -1338,10 +1347,10 @@ components:
ty:
type: boolean
required:
- - terminal
- - pylsp
- - ty
- - basedpyright
+ - terminal
+ - pylsp
+ - ty
+ - basedpyright
type: object
cell_ids:
items:
@@ -1376,12 +1385,12 @@ components:
type:
type: string
required:
- - type
- - data
+ - type
+ - data
type: object
name:
enum:
- - kernel-ready
+ - kernel-ready
type: string
names:
items:
@@ -1393,59 +1402,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:
@@ -1454,14 +1463,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:
@@ -1470,7 +1479,7 @@ components:
$ref: '#/components/schemas/SecretKeysWithProvider'
type: array
required:
- - keys
+ - keys
type: object
MIME:
properties: {}
@@ -1486,12 +1495,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:
@@ -1501,12 +1510,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:
@@ -1527,39 +1536,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:
@@ -1570,8 +1579,8 @@ components:
properties:
cell_output:
enum:
- - above
- - below
+ - above
+ - below
type: string
code_editor_font_size:
type: integer
@@ -1581,8 +1590,8 @@ components:
type: array
dataframes:
enum:
- - rich
- - plain
+ - rich
+ - plain
type: string
default_table_max_columns:
type: integer
@@ -1590,28 +1599,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: {}
@@ -1621,7 +1630,7 @@ components:
line_length:
type: integer
required:
- - line_length
+ - line_length
type: object
keymap:
properties:
@@ -1633,14 +1642,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:
@@ -1676,14 +1685,14 @@ components:
properties:
manager:
enum:
- - pip
- - rye
- - uv
- - poetry
- - pixi
+ - pip
+ - rye
+ - uv
+ - poetry
+ - pixi
type: string
required:
- - manager
+ - manager
type: object
runtime:
properties:
@@ -1691,25 +1700,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:
@@ -1717,8 +1726,8 @@ components:
type: array
on_cell_change:
enum:
- - lazy
- - autorun
+ - lazy
+ - autorun
type: string
output_max_bytes:
type: integer
@@ -1732,48 +1741,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:
@@ -1792,14 +1801,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:
@@ -1812,12 +1821,12 @@ components:
type: string
type:
enum:
- - exception
+ - exception
type: string
required:
- - msg
- - exception_type
- - type
+ - msg
+ - exception_type
+ - type
type: object
MarimoFile:
properties:
@@ -1835,8 +1844,8 @@ components:
nullable: true
type: string
required:
- - name
- - path
+ - name
+ - path
type: object
MarimoInternalError:
properties:
@@ -1846,21 +1855,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:
@@ -1873,12 +1882,12 @@ components:
type: string
type:
enum:
- - strict-exception
+ - strict-exception
type: string
required:
- - msg
- - ref
- - type
+ - msg
+ - ref
+ - type
type: object
MarimoSyntaxError:
properties:
@@ -1886,66 +1895,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:
@@ -1953,16 +1962,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:
@@ -1974,29 +1983,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:
@@ -2016,22 +2025,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:
@@ -2040,8 +2049,8 @@ components:
version:
type: string
required:
- - name
- - version
+ - name
+ - version
type: object
PackageOperationResponse:
properties:
@@ -2051,7 +2060,7 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
PdbRequest:
properties:
@@ -2061,14 +2070,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:
@@ -2081,18 +2090,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:
@@ -2105,10 +2114,10 @@ components:
schema:
type: string
required:
- - requestId
- - engine
- - database
- - schema
+ - requestId
+ - engine
+ - database
+ - schema
type: object
PreviewSQLTableRequest:
properties:
@@ -2123,11 +2132,11 @@ components:
tableName:
type: string
required:
- - requestId
- - engine
- - database
- - schema
- - tableName
+ - requestId
+ - engine
+ - database
+ - schema
+ - tableName
type: object
QueryParamsAppend:
properties:
@@ -2135,23 +2144,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:
@@ -2159,14 +2168,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:
@@ -2174,25 +2183,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:
@@ -2201,32 +2210,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:
@@ -2234,25 +2243,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:
@@ -2268,8 +2277,8 @@ components:
$ref: '#/components/schemas/HTTPRequest'
nullable: true
required:
- - cellIds
- - codes
+ - cellIds
+ - codes
type: object
RunningNotebooksResponse:
properties:
@@ -2278,14 +2287,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:
@@ -2294,7 +2303,7 @@ components:
type: string
name:
enum:
- - sql-table-list-preview
+ - sql-table-list-preview
type: string
request_id:
type: string
@@ -2303,9 +2312,9 @@ components:
$ref: '#/components/schemas/DataTable'
type: array
required:
- - request_id
- - tables
- - name
+ - request_id
+ - tables
+ - name
type: object
SQLTablePreview:
properties:
@@ -2314,7 +2323,7 @@ components:
type: string
name:
enum:
- - sql-table-preview
+ - sql-table-preview
type: string
request_id:
type: string
@@ -2322,8 +2331,8 @@ components:
$ref: '#/components/schemas/DataTable'
nullable: true
required:
- - request_id
- - name
+ - request_id
+ - name
type: object
SaveAppConfigurationRequest:
properties:
@@ -2331,7 +2340,7 @@ components:
additionalProperties: {}
type: object
required:
- - config
+ - config
type: object
SaveNotebookRequest:
properties:
@@ -2360,19 +2369,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:
@@ -2383,8 +2392,8 @@ components:
$ref: '#/components/schemas/DataTable'
type: array
required:
- - name
- - tables
+ - name
+ - tables
type: object
SchemaColumn:
properties:
@@ -2396,9 +2405,9 @@ components:
type:
type: string
required:
- - name
- - type
- - sampleValues
+ - name
+ - type
+ - sampleValues
type: object
SchemaTable:
properties:
@@ -2409,14 +2418,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
@@ -2425,9 +2434,9 @@ components:
$ref: '#/components/schemas/SecretKeysWithProvider'
type: array
required:
- - request_id
- - secrets
- - name
+ - request_id
+ - secrets
+ - name
type: object
SecretKeysWithProvider:
properties:
@@ -2439,13 +2448,13 @@ components:
type: string
provider:
enum:
- - env
- - dotenv
+ - env
+ - dotenv
type: string
required:
- - provider
- - name
- - keys
+ - provider
+ - name
+ - keys
type: object
SendUIElementMessage:
properties:
@@ -2462,14 +2471,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:
@@ -2479,7 +2488,7 @@ components:
type: object
type: object
required:
- - configs
+ - configs
type: object
SetModelMessageRequest:
properties:
@@ -2494,22 +2503,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:
@@ -2526,43 +2535,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:
@@ -2573,8 +2582,8 @@ components:
title:
type: string
required:
- - title
- - sections
+ - title
+ - sections
type: object
SnippetSection:
properties:
@@ -2587,7 +2596,7 @@ components:
id:
type: string
required:
- - id
+ - id
type: object
Snippets:
properties:
@@ -2596,14 +2605,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: {}
@@ -2613,7 +2622,7 @@ components:
success:
type: boolean
required:
- - success
+ - success
type: object
UnknownError:
properties:
@@ -2621,11 +2630,11 @@ components:
type: string
type:
enum:
- - unknown
+ - unknown
type: string
required:
- - msg
- - type
+ - msg
+ - type
type: object
UpdateCellCodes:
properties:
@@ -2641,13 +2650,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:
@@ -2657,11 +2666,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:
@@ -2673,8 +2682,8 @@ components:
items: {}
type: array
required:
- - objectIds
- - values
+ - objectIds
+ - values
type: object
VariableContext:
properties:
@@ -2684,9 +2693,9 @@ components:
valueType:
type: string
required:
- - name
- - valueType
- - previewValue
+ - name
+ - valueType
+ - previewValue
type: object
VariableDeclaration:
properties:
@@ -2701,9 +2710,9 @@ components:
type: string
type: array
required:
- - name
- - declared_by
- - used_by
+ - name
+ - declared_by
+ - used_by
type: object
VariableValue:
properties:
@@ -2716,42 +2725,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:
@@ -2762,8 +2771,8 @@ components:
root:
type: string
required:
- - root
- - files
+ - root
+ - files
type: object
info:
title: marimo API
@@ -2773,12 +2782,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:
@@ -3623,7 +3632,7 @@ paths:
percent:
type: number
required:
- - percent
+ - percent
type: object
gpu:
items:
@@ -3641,17 +3650,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:
@@ -3672,22 +3681,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:
@@ -3725,4 +3734,5 @@ 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 5a545f24a8..09f6a1a7bd 100644
--- a/packages/openapi/src/api.ts
+++ b/packages/openapi/src/api.ts
@@ -2568,6 +2568,7 @@ export interface components {
anthropic?: components["schemas"]["AnthropicConfig"];
azure?: components["schemas"]["OpenAiConfig"];
bedrock?: components["schemas"]["BedrockConfig"];
+ github?: components["schemas"]["GitHubConfig"];
google?: components["schemas"]["GoogleAiConfig"];
max_tokens?: number;
/** @enum {string} */
@@ -2576,8 +2577,8 @@ export interface components {
autocomplete_model?: string;
chat_model?: string;
custom_models: string[];
- edit_model?: string;
displayed_models: string[];
+ edit_model?: string;
};
ollama?: components["schemas"]["OpenAiConfig"];
open_ai?: components["schemas"]["OpenAiConfig"];
@@ -3019,6 +3020,10 @@ export interface components {
| null;
status: components["schemas"]["HumanReadableStatus"];
};
+ GitHubConfig: {
+ api_key?: string;
+ base_url?: string;
+ };
GoogleAiConfig: {
api_key?: string;
};
diff --git a/tests/_output/formatters/test_formatters.py b/tests/_output/formatters/test_formatters.py
index a7fa8e4a1a..119fa1e9e9 100644
--- a/tests/_output/formatters/test_formatters.py
+++ b/tests/_output/formatters/test_formatters.py
@@ -486,6 +486,7 @@ def test_polars_dot_to_mermaid() -> None:
@pytest.mark.skipif(not HAS_DEPS, reason="optional dependencies not installed")
[email protected](reason="TODO: skipping since upstream broken this test")
def test_polars_dot_to_mermaid_complex() -> None:
import polars as pl
diff --git a/tests/_server/ai/test_ai_config.py b/tests/_server/ai/test_ai_config.py
index 2ac01fb1e3..944f745497 100644
--- a/tests/_server/ai/test_ai_config.py
+++ b/tests/_server/ai/test_ai_config.py
@@ -122,6 +122,42 @@ class TestAnyProviderConfig:
assert provider_config.api_key == "ollama-placeholder"
+ def test_for_ollama_fallback_url(self):
+ """Test Ollama configuration with fallback base URL."""
+ config: AiConfig = {"ollama": {}}
+
+ provider_config = AnyProviderConfig.for_ollama(config)
+
+ assert provider_config.api_key == "ollama-placeholder"
+ assert provider_config.base_url == "http://127.0.0.1:11434/v1"
+
+ def test_for_github(self):
+ """Test GitHub configuration."""
+ config: AiConfig = {
+ "github": {
+ "api_key": "test-github-key",
+ "base_url": "https://api.githubcopilot.com/",
+ }
+ }
+
+ provider_config = AnyProviderConfig.for_github(config)
+
+ assert provider_config.api_key == "test-github-key"
+ assert provider_config.base_url == "https://api.githubcopilot.com/"
+
+ def test_for_github_with_fallback_base_url(self):
+ """Test GitHub configuration uses fallback base URL when not specified."""
+ config: AiConfig = {
+ "github": {
+ "api_key": "test-github-key",
+ }
+ }
+
+ provider_config = AnyProviderConfig.for_github(config)
+
+ assert provider_config.api_key == "test-github-key"
+ assert provider_config.base_url == "https://api.githubcopilot.com/"
+
def test_for_anthropic(self):
"""Test Anthropic configuration."""
config: AiConfig = {
@@ -195,6 +231,14 @@ class TestAnyProviderConfig:
assert provider_config.api_key == "test-anthropic-key"
+ def test_for_model_github(self) -> None:
+ """Test for_model with GitHub model."""
+ config: AiConfig = {"github": {"api_key": "test-github-key"}}
+
+ provider_config = AnyProviderConfig.for_model("github/gpt-4o", config)
+
+ assert provider_config.api_key == "test-github-key"
+
def test_for_model_unknown_defaults_to_ollama(self) -> None:
"""Test for_model with unknown provider defaults to Ollama."""
config: AiConfig = {"ollama": {"api_key": "test-key"}}
@@ -416,6 +460,35 @@ class TestProviderConfigWithFallback:
assert exc_info.value.status_code == HTTPStatus.BAD_REQUEST
assert "Google AI API key not configured" in str(exc_info.value.detail)
+ @patch.dict(os.environ, {"GITHUB_TOKEN": "env-github-token"})
+ def test_for_github_with_fallback_key(self) -> None:
+ """Test GitHub config uses fallback key when config is missing api_key."""
+ config: AiConfig = {"github": {}}
+
+ provider_config = AnyProviderConfig.for_github(config)
+
+ assert provider_config.api_key == "env-github-token"
+
+ @patch.dict(os.environ, {"GITHUB_TOKEN": "env-github-token"})
+ def test_for_github_config_key_takes_precedence(self) -> None:
+ """Test GitHub config key takes precedence over environment variable."""
+ config: AiConfig = {"github": {"api_key": "config-github-token"}}
+
+ provider_config = AnyProviderConfig.for_github(config)
+
+ assert provider_config.api_key == "config-github-token"
+
+ @patch.dict(os.environ, {}, clear=True)
+ def test_for_github_no_fallback_available(self) -> None:
+ """Test GitHub config fails when no config key and no env var."""
+ config: AiConfig = {"github": {}}
+
+ with pytest.raises(HTTPException) as exc_info:
+ AnyProviderConfig.for_github(config)
+
+ assert exc_info.value.status_code == HTTPStatus.BAD_REQUEST
+ assert "GitHub API key not configured" in str(exc_info.value.detail)
+
class TestGetKey:
"""Tests for _get_key function."""
@@ -911,3 +984,13 @@ class TestEdgeCases:
assert "OpenAI Compatible config not found" in str(
exc_info.value.detail
)
+
+ def test_github_config_missing(self):
+ """Test error when GitHub config is missing."""
+ config: AiConfig = {}
+
+ with pytest.raises(HTTPException) as exc_info:
+ AnyProviderConfig.for_github(config)
+
+ assert exc_info.value.status_code == HTTPStatus.BAD_REQUEST
+ assert "GitHub config not found" in str(exc_info.value.detail)