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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
add config to disable AI (#9739)
Shahmir Varqhaf0c3a8055914
diff --git a/docs/guides/editor_features/ai_completion.md b/docs/guides/editor_features/ai_completion.mdindex 090b9221f1..421ed5c14f 100644--- a/docs/guides/editor_features/ai_completion.md+++ b/docs/guides/editor_features/ai_completion.md@@ -152,6 +152,19 @@ You can configure the following providers:See the [llm_providers](../configuration/llm_providers.md) guide for detailed instructions on how to configure each provider.+## Hide AI actions and panels++If you don't use marimo's AI assistant, you can hide AI actions and panels in the editor:++```toml title="marimo.toml"+[ai]+enabled = false+```++This hides AI assistant surfaces such as the Chat panel and Generate with AI. Code completion settings including GitHub Copilot, remain available.++You can still collaborate with an AI agent using [marimo pair](../generate_with_ai/marimo_pair.md).+## Agents!!! example "Experimental: Agents"diff --git a/frontend/src/components/app-config/ai-config.tsx b/frontend/src/components/app-config/ai-config.tsxindex 839d3b07b3..0ef54161de 100644--- a/frontend/src/components/app-config/ai-config.tsx+++ b/frontend/src/components/app-config/ai-config.tsx@@ -1849,6 +1849,38 @@ export type AiSettingsSubTab =| "ai-models"| "mcp";+const AiEnabledConfig: React.FC<AiConfigProps> = ({ form, config }) => {+ return (+ <SettingGroup>+ <FormField+ control={form.control}+ name="ai.enabled"+ render={({ field }) => (+ <div className="flex flex-col gap-y-1">+ <FormItem className={formItemClasses}>+ <FormLabel className="font-normal">Enable AI features</FormLabel>+ <FormControl>+ <Checkbox+ data-testid="ai-enabled-checkbox"+ checked={field.value !== false}+ onCheckedChange={(checked) =>+ field.onChange(checked === true)+ }+ />+ </FormControl>+ <IsOverridden userConfig={config} name="ai.enabled" />+ </FormItem>+ <FormDescription>+ When disabled, AI actions and panels are hidden from the marimo+ UI.+ </FormDescription>+ </div>+ )}+ />+ </SettingGroup>+ );+};+export const AiConfig: React.FC<AiConfigProps> = ({form,config,@@ -1857,18 +1889,30 @@ export const AiConfig: React.FC<AiConfigProps> = ({// MCP is not supported in WASMconst wasm = isWasm();const [activeTab, setActiveTab] = useAtom(aiSettingsSubTabAtom);+ const aiEnabled = useWatch({+ control: form.control,+ name: "ai.enabled",+ });+ const activeVisibleTab =+ aiEnabled === false && activeTab !== "ai-features"+ ? "ai-features"+ : activeTab;return (<Tabs- value={activeTab}+ value={activeVisibleTab}onValueChange={(value) => setActiveTab(value as AiSettingsSubTab)}className="flex-1"><TabsList className="mb-2"><TabsTrigger value="ai-features">AI Features</TabsTrigger>- <TabsTrigger value="ai-providers">AI Providers</TabsTrigger>- <TabsTrigger value="ai-models">AI Models</TabsTrigger>- {!wasm && <TabsTrigger value="mcp">MCP</TabsTrigger>}+ {aiEnabled !== false && (+ <>+ <TabsTrigger value="ai-providers">AI Providers</TabsTrigger>+ <TabsTrigger value="ai-models">AI Models</TabsTrigger>+ {!wasm && <TabsTrigger value="mcp">MCP</TabsTrigger>}+ </>+ )}</TabsList><TabsContent value="ai-features">@@ -1877,18 +1921,33 @@ export const AiConfig: React.FC<AiConfigProps> = ({config={config}onSubmit={onSubmit}/>- <AiAssistConfig form={form} config={config} onSubmit={onSubmit} />- </TabsContent>- <TabsContent value="ai-providers">- <AiProvidersConfig form={form} config={config} onSubmit={onSubmit} />- </TabsContent>- <TabsContent value="ai-models">- <AiModelDisplayConfig form={form} config={config} onSubmit={onSubmit} />+ <AiEnabledConfig form={form} config={config} onSubmit={onSubmit} />+ {aiEnabled !== false && (+ <AiAssistConfig form={form} config={config} onSubmit={onSubmit} />+ )}</TabsContent>- {!wasm && (- <TabsContent value="mcp">- <MCPConfig form={form} onSubmit={onSubmit} />- </TabsContent>+ {aiEnabled !== false && (+ <>+ <TabsContent value="ai-providers">+ <AiProvidersConfig+ form={form}+ config={config}+ onSubmit={onSubmit}+ />+ </TabsContent>+ <TabsContent value="ai-models">+ <AiModelDisplayConfig+ form={form}+ config={config}+ onSubmit={onSubmit}+ />+ </TabsContent>+ {!wasm && (+ <TabsContent value="mcp">+ <MCPConfig form={form} onSubmit={onSubmit} />+ </TabsContent>+ )}+ </>)}</Tabs>);diff --git a/frontend/src/components/chat/chat-panel.tsx b/frontend/src/components/chat/chat-panel.tsxindex d81f1d9cc8..95a7d9388b 100644--- a/frontend/src/components/chat/chat-panel.tsx+++ b/frontend/src/components/chat/chat-panel.tsx@@ -51,7 +51,7 @@ import {FRONTEND_TOOL_REGISTRY,} from "@/core/ai/tools/registry";import { useCellActions } from "@/core/cells/cells";-import { aiAtom, aiEnabledAtom } from "@/core/config/config";+import { aiAtom, aiModelConfiguredAtom } from "@/core/config/config";import { DEFAULT_AI_MODEL } from "@/core/config/config-schema";import { useRequestClient } from "@/core/network/requests";import { useRuntimeManager } from "@/core/runtime/config";@@ -442,7 +442,7 @@ const PairWithAgentCallout: React.FC<{};const ChatPanel = () => {- const aiConfigured = useAtomValue(aiEnabledAtom);+ const aiConfigured = useAtomValue(aiModelConfiguredAtom);const { handleClick } = useOpenSettingsToTab();if (!aiConfigured) {diff --git a/frontend/src/components/editor/actions/useCellActionButton.tsx b/frontend/src/components/editor/actions/useCellActionButton.tsxindex 2971a8915a..d0d3bd4b7e 100644--- a/frontend/src/components/editor/actions/useCellActionButton.tsx+++ b/frontend/src/components/editor/actions/useCellActionButton.tsx@@ -48,7 +48,7 @@ import {import { switchLanguage } from "@/core/codemirror/language/extension";import { MARKDOWN_INITIAL_HIDE_CODE } from "@/core/codemirror/language/languages/markdown";import {- aiEnabledAtom,+ aiFeaturesEnabledAtom,appWidthAtom,autoInstantiateAtom,} from "@/core/config/config";@@ -100,7 +100,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {const deleteCell = useDeleteCellCallback();const { openModal } = useImperativeModal();const setAiCompletionCell = useSetAtom(aiCompletionCellAtom);- const aiEnabled = useAtomValue(aiEnabledAtom);+ const aiFeaturesEnabled = useAtomValue(aiFeaturesEnabledAtom);const autoInstantiate = useAtomValue(autoInstantiateAtom);const kioskMode = useAtomValue(kioskModeAtom);const appWidth = useAtomValue(appWidthAtom);@@ -162,7 +162,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {{icon: <SparklesIcon size={13} strokeWidth={1.5} />,label: "Refactor with AI",- hidden: !aiEnabled,+ hidden: !aiFeaturesEnabled,handle: () => {setAiCompletionCell((current) =>current?.cellId === cellId ? null : { cellId },diff --git a/frontend/src/components/editor/cell/code/cell-editor.tsx b/frontend/src/components/editor/cell/code/cell-editor.tsxindex 7974023083..ff0509f767 100644--- a/frontend/src/components/editor/cell/code/cell-editor.tsx+++ b/frontend/src/components/editor/cell/code/cell-editor.tsx@@ -26,7 +26,7 @@ import {connectedDocAtom,realTimeCollaboration,} from "@/core/codemirror/rtc/extension";-import { autoInstantiateAtom, isAiEnabled } from "@/core/config/config";+import { autoInstantiateAtom, isAiFeatureEnabled } from "@/core/config/config";import type { UserConfig } from "@/core/config/config-schema";import { OverridingHotkeyProvider } from "@/core/hotkeys/hotkeys";import { connectionAtom } from "@/core/network/connection";@@ -173,13 +173,13 @@ const CellEditorInternal = ({});});- const aiEnabled = isAiEnabled(userConfig);+ const aiFeaturesEnabled = isAiFeatureEnabled(userConfig);const extensions = useMemo(() => {const extensions = setupCodeMirror({cellId,showPlaceholder,- enableAI: aiEnabled,+ enableAI: aiFeaturesEnabled,cellActions: {...cellActions,afterToggleMarkdown,@@ -201,6 +201,9 @@ const CellEditorInternal = ({splitCell,toggleHideCode,aiCellCompletion: () => {+ if (!aiFeaturesEnabled) {+ return false;+ }let closed = false;setAiCompletionCell((v) => {// Toggle close@@ -271,7 +274,7 @@ const CellEditorInternal = ({userConfig.display,userConfig.diagnostics,userConfig.ai?.inline_tooltip,- aiEnabled,+ aiFeaturesEnabled,theme,showPlaceholder,cellActions,diff --git a/frontend/src/components/editor/chrome/types.ts b/frontend/src/components/editor/chrome/types.tsindex 2092ba4694..3de3c0b1e9 100644--- a/frontend/src/components/editor/chrome/types.ts+++ b/frontend/src/components/editor/chrome/types.ts@@ -201,16 +201,23 @@ export const PANEL_MAP = new Map<PanelType, PanelDescriptor>();/**- * Check if a panel should be hidden based on its `hidden` property- * and `requiredCapability`.+ * Check if a panel should be hidden based on its descriptor and runtime state.*/-export function isPanelHidden(- panel: PanelDescriptor,- capabilities: Capabilities,-): boolean {+export function isPanelHidden({+ panel,+ capabilities,+ aiEnabled,+}: {+ panel: PanelDescriptor;+ capabilities: Capabilities;+ aiEnabled: boolean;+}): boolean {if (panel.hidden) {return true;}+ if (panel.type === "ai" && !aiEnabled) {+ return true;+ }if (panel.requiredCapability && !capabilities[panel.requiredCapability]) {return true;}diff --git a/frontend/src/components/editor/chrome/wrapper/app-chrome.tsx b/frontend/src/components/editor/chrome/wrapper/app-chrome.tsxindex aa4555502d..37991cff2e 100644--- a/frontend/src/components/editor/chrome/wrapper/app-chrome.tsx+++ b/frontend/src/components/editor/chrome/wrapper/app-chrome.tsx@@ -27,6 +27,7 @@ import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";import { LazyActivity } from "@/components/utils/lazy-mount";import { cellErrorCount } from "@/core/cells/cells";import { capabilitiesAtom } from "@/core/config/capabilities";+import { aiEnabledAtom } from "@/core/config/config";import { getFeatureFlag } from "@/core/config/feature-flag";import { cn } from "@/utils/cn";import { ErrorBoundary } from "../../boundary/ErrorBoundary";@@ -93,18 +94,19 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {const [panelLayout, setPanelLayout] = useAtom(panelLayoutAtom);// Subscribe to capabilities to re-render when they change (e.g., terminal capability)const capabilities = useAtomValue(capabilitiesAtom);+ const aiEnabled = useAtomValue(aiEnabledAtom);// Convert current developer panel items to PanelDescriptors// Filter out hidden panels (e.g., terminal when capability is not available)const devPanelItems = useMemo(() => {return panelLayout.developerPanel.flatMap((id) => {const panel = PANEL_MAP.get(id);- if (!panel || isPanelHidden(panel, capabilities)) {+ if (!panel || isPanelHidden({ panel, capabilities, aiEnabled })) {return [];}return [panel];});- }, [panelLayout.developerPanel, capabilities]);+ }, [panelLayout.developerPanel, capabilities, aiEnabled]);const handleSetDevPanelItems = (items: PanelDescriptor[]) => {setPanelLayout((prev) => ({@@ -141,7 +143,7 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {const availableDevPanels = useMemo(() => {const sidebarIds = new Set(panelLayout.sidebar);return PANELS.filter((p) => {- if (isPanelHidden(p, capabilities)) {+ if (isPanelHidden({ panel: p, capabilities, aiEnabled })) {return false;}// Exclude panels that are in the sidebar@@ -150,7 +152,7 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {}return true;});- }, [panelLayout.sidebar, capabilities]);+ }, [panelLayout.sidebar, capabilities, aiEnabled]);const emitResizeEvent = useEvent(() => {// HACK: Unfortunately, we have to do this twice to make sure thediff --git a/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx b/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsxindex 2209f978b6..03e3301190 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@@ -4,18 +4,27 @@ import { useAtomValue } from "jotai";import { SparklesIcon } from "lucide-react";import React from "react";import { useOpenSettingsToTab } from "@/components/app-config/state";-import { aiAtom, aiEnabledAtom } from "@/core/config/config";+import {+ aiAtom,+ aiEnabledAtom,+ aiModelConfiguredAtom,+} 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 aiModelConfigured = useAtomValue(aiModelConfiguredAtom);const chatModel = ai?.models?.chat_model || DEFAULT_AI_MODEL;const editModel = ai?.models?.edit_model || chatModel;const { handleClick } = useOpenSettingsToTab();if (!aiEnabled) {+ return null;+ }++ if (!aiModelConfigured) {return (<FooterItemtooltip="Assist is disabled"diff --git a/frontend/src/components/editor/chrome/wrapper/sidebar.tsx b/frontend/src/components/editor/chrome/wrapper/sidebar.tsxindex ae80e0a4f8..f1b55793a0 100644--- a/frontend/src/components/editor/chrome/wrapper/sidebar.tsx+++ b/frontend/src/components/editor/chrome/wrapper/sidebar.tsx@@ -12,6 +12,7 @@ import {notebookQueuedOrRunningCountAtom,} from "@/core/cells/cells";import { capabilitiesAtom } from "@/core/config/capabilities";+import { aiEnabledAtom } from "@/core/config/config";import { cn } from "@/utils/cn";import { FeedbackButton } from "../components/feedback-button";import { panelLayoutAtom, useChromeActions, useChromeState } from "../state";@@ -30,6 +31,7 @@ export const Sidebar: React.FC = () => {const [panelLayout, setPanelLayout] = useAtom(panelLayoutAtom);// Subscribe to capabilities to re-render when they changeconst capabilities = useAtomValue(capabilitiesAtom);+ const aiEnabled = useAtomValue(aiEnabledAtom);const renderIcon = ({ Icon }: PanelDescriptor, className?: string) => {return <Icon className={cn("h-5 w-5", className)} />;@@ -40,7 +42,7 @@ export const Sidebar: React.FC = () => {const availableSidebarPanels = useMemo(() => {const devPanelIds = new Set(panelLayout.developerPanel);return PANELS.filter((p) => {- if (isPanelHidden(p, capabilities)) {+ if (isPanelHidden({ panel: p, capabilities, aiEnabled })) {return false;}// Exclude panels that are in the developer panel@@ -49,19 +51,19 @@ export const Sidebar: React.FC = () => {}return true;});- }, [panelLayout.developerPanel, capabilities]);+ }, [panelLayout.developerPanel, capabilities, aiEnabled]);// Convert current sidebar items to PanelDescriptors// Filter out hidden panels (e.g., when capability is not available)const sidebarItems = useMemo(() => {return panelLayout.sidebar.flatMap((id) => {const panel = PANEL_MAP.get(id);- if (!panel || isPanelHidden(panel, capabilities)) {+ if (!panel || isPanelHidden({ panel, capabilities, aiEnabled })) {return [];}return [panel];});- }, [panelLayout.sidebar, capabilities]);+ }, [panelLayout.sidebar, capabilities, aiEnabled]);const handleSetSidebarItems = (items: PanelDescriptor[]) => {setPanelLayout((prev) => ({@@ -218,7 +220,7 @@ const SidebarItem: React.FC<// Render as div when not clickable (e.g., inside ReorderableList)// This avoids nested interactive elements which break react-aria's drag behaviorconst content = onClick ? (- <button className={itemClassName} onClick={onClick}>+ <button type="button" className={itemClassName} onClick={onClick}>{children}</button>) : (diff --git a/frontend/src/components/editor/errors/auto-fix.tsx b/frontend/src/components/editor/errors/auto-fix.tsxindex 739ef98d6f..4dc7387afb 100644--- a/frontend/src/components/editor/errors/auto-fix.tsx+++ b/frontend/src/components/editor/errors/auto-fix.tsx@@ -13,7 +13,7 @@ import { Tooltip } from "@/components/ui/tooltip";import { aiCompletionCellAtom } from "@/core/ai/state";import { notebookAtom, useCellActions } from "@/core/cells/cells";import type { CellId } from "@/core/cells/ids";-import { aiEnabledAtom } from "@/core/config/config";+import { aiFeaturesEnabledAtom } from "@/core/config/config";import { getAutoFixes } from "@/core/errors/errors";import type { MarimoError } from "@/core/kernel/messages";import { cn } from "@/utils/cn";@@ -30,9 +30,9 @@ export const AutoFixButton = ({}) => {const store = useStore();const { createNewCell } = useCellActions();- const aiEnabled = useAtomValue(aiEnabledAtom);+ const aiFeaturesEnabled = useAtomValue(aiFeaturesEnabledAtom);const autoFixes = errors.flatMap((error) =>- getAutoFixes(error, { aiEnabled }),+ getAutoFixes(error, { aiEnabled: aiFeaturesEnabled }),);const setAiCompletionCell = useSetAtom(aiCompletionCellAtom);diff --git a/frontend/src/components/editor/navigation/__tests__/navigation.test.ts b/frontend/src/components/editor/navigation/__tests__/navigation.test.tsindex a2aefb6a61..5fb8dc6013 100644--- a/frontend/src/components/editor/navigation/__tests__/navigation.test.ts+++ b/frontend/src/components/editor/navigation/__tests__/navigation.test.ts@@ -1207,6 +1207,21 @@ describe("useCellNavigationProps", () => {});describe("AI completion functionality", () => {+ beforeEach(() => {+ const config = defaultUserConfig();+ store.set(userConfigAtom, {+ ...config,+ ai: {+ ...config.ai,+ models: {+ displayed_models: [],+ custom_models: [],+ edit_model: "openai/gpt-4o",+ },+ },+ });+ });+it("should toggle AI completion when shortcut is pressed", () => {const { result } = renderWithProvider(() =>useCellNavigationProps(cellId1, optionsWithMockEditor),diff --git a/frontend/src/components/editor/navigation/navigation.ts b/frontend/src/components/editor/navigation/navigation.tsindex a9cb330610..824f7c9147 100644--- a/frontend/src/components/editor/navigation/navigation.ts+++ b/frontend/src/components/editor/navigation/navigation.ts@@ -24,6 +24,7 @@ import { usePendingDeleteService } from "@/core/cells/pending-delete-service";import { scrollCellIntoView } from "@/core/cells/scrollCellIntoView";import {hotkeysAtom,+ isAiFeatureEnabled,keymapPresetAtom,userConfigAtom,} from "@/core/config/config";@@ -195,6 +196,7 @@ export function useCellNavigationProps(const pendingDeleteService = usePendingDeleteService();const deleteCells = useDeleteManyCellsCallback();const userConfig = useAtomValue(userConfigAtom);+ const aiFeaturesEnabled = isAiFeatureEnabled(userConfig);// Wrap selection actions to clear pending cells on any selection changeconst selectionActions = {@@ -496,6 +498,9 @@ export function useCellNavigationProps(return true;}),"cell.aiCompletion": (cellId) => {+ if (!aiFeaturesEnabled) {+ return false;+ }let closed = false;setAiCompletionCell((v) => {// Toggle closediff --git a/frontend/src/components/editor/output/MarimoTracebackOutput.tsx b/frontend/src/components/editor/output/MarimoTracebackOutput.tsxindex fb264ea56d..d5ba1e7df0 100644--- a/frontend/src/components/editor/output/MarimoTracebackOutput.tsx+++ b/frontend/src/components/editor/output/MarimoTracebackOutput.tsx@@ -25,7 +25,7 @@ import { getCellEditorView } from "@/core/cells/cells";import type { CellId } from "@/core/cells/ids";import { SCRATCH_CELL_ID } from "@/core/cells/ids";import { insertDebuggerAtLine } from "@/core/codemirror/editing/debugging";-import { aiEnabledAtom } from "@/core/config/config";+import { aiFeaturesEnabledAtom } from "@/core/config/config";import { getRequestClient } from "@/core/network/requests";import { isStaticNotebook } from "@/core/static/static-state";import { isWasm } from "@/core/wasm/utils";@@ -70,7 +70,7 @@ export const MarimoTracebackOutput = ({});const lastTracebackLine = lastLine(traceback);- const aiEnabled = useAtomValue(aiEnabledAtom);+ const aiFeaturesEnabled = useAtomValue(aiFeaturesEnabledAtom);// Get last traceback infoconst tracebackInfo = extractAllTracebackInfo(traceback)?.at(0);@@ -83,7 +83,8 @@ export const MarimoTracebackOutput = ({!isStaticNotebook() &&cellId !== SCRATCH_CELL_ID;- const showAIFix = onRefactorWithAI && aiEnabled && !isStaticNotebook();+ const showAIFix =+ onRefactorWithAI && aiFeaturesEnabled && !isStaticNotebook();const showSearch = !isStaticNotebook();diff --git a/frontend/src/components/editor/renderers/cell-array.tsx b/frontend/src/components/editor/renderers/cell-array.tsxindex 8501c22fce..04faac42de 100644--- a/frontend/src/components/editor/renderers/cell-array.tsx+++ b/frontend/src/components/editor/renderers/cell-array.tsx@@ -24,7 +24,7 @@ import { maybeAddMarimoImport } from "@/core/cells/add-missing-import";import { SETUP_CELL_ID } from "@/core/cells/ids";import { LanguageAdapters } from "@/core/codemirror/language/LanguageAdapters";import { MARKDOWN_INITIAL_HIDE_CODE } from "@/core/codemirror/language/languages/markdown";-import { aiEnabledAtom } from "@/core/config/config";+import { aiEnabledAtom, aiFeaturesEnabledAtom } from "@/core/config/config";import { canInteractWithAppAtom } from "@/core/network/connection";import { useBoolean } from "@/hooks/useBoolean";import { cn } from "@/utils/cn";@@ -261,6 +261,7 @@ const AddCellButtons: React.FC<{const { createNewCell } = useCellActions();const [isAiButtonOpen, isAiButtonOpenActions] = useBoolean(false);const aiEnabled = useAtomValue(aiEnabledAtom);+ const aiFeaturesEnabled = useAtomValue(aiFeaturesEnabledAtom);const canInteractWithApp = useAtomValue(canInteractWithAppAtom);const { handleClick } = useOpenSettingsToTab();@@ -270,7 +271,7 @@ const AddCellButtons: React.FC<{);const renderBody = () => {- if (isAiButtonOpen) {+ if (aiEnabled && isAiButtonOpen) {return <AddCellWithAI onClose={isAiButtonOpenActions.toggle} />;}@@ -328,30 +329,32 @@ const AddCellButtons: React.FC<{<DatabaseIcon className="mr-2 size-4 shrink-0" />SQL</Button>- <Tooltip- content={- aiEnabled ? null : (- <span>AI provider not found or Edit model not selected</span>- )- }- delayDuration={100}- asChild={false}- >- <Button- className={buttonClass}- variant="text"- size="sm"- disabled={!canInteractWithApp}- onClick={- aiEnabled- ? isAiButtonOpenActions.toggle- : () => handleClick("ai", "ai-providers")+ {aiEnabled && (+ <Tooltip+ content={+ aiFeaturesEnabled ? null : (+ <span>AI provider not found or Edit model not selected</span>+ )}+ delayDuration={100}+ asChild={false}>- <SparklesIcon className="mr-2 size-4 shrink-0" />- Generate with AI- </Button>- </Tooltip>+ <Button+ className={buttonClass}+ variant="text"+ size="sm"+ disabled={!canInteractWithApp}+ onClick={+ aiFeaturesEnabled+ ? isAiButtonOpenActions.toggle+ : () => handleClick("ai", "ai-providers")+ }+ >+ <SparklesIcon className="mr-2 size-4 shrink-0" />+ Generate with AI+ </Button>+ </Tooltip>+ )}</>);};diff --git a/frontend/src/core/config/__tests__/config-schema.test.ts b/frontend/src/core/config/__tests__/config-schema.test.tsindex b2f22da698..40fc953f4e 100644--- a/frontend/src/core/config/__tests__/config-schema.test.ts+++ b/frontend/src/core/config/__tests__/config-schema.test.ts@@ -46,6 +46,7 @@ test("default UserConfig - empty", () => {{"ai": {"custom_providers": {},+ "enabled": true,"inline_tooltip": false,"mode": "manual","models": {@@ -118,6 +119,7 @@ test("default UserConfig - one level", () => {{"ai": {"custom_providers": {},+ "enabled": true,"inline_tooltip": false,"mode": "manual","models": {diff --git a/frontend/src/core/config/config-schema.ts b/frontend/src/core/config/config-schema.tsindex 3c26afe420..fe7d75aef0 100644--- a/frontend/src/core/config/config-schema.ts+++ b/frontend/src/core/config/config-schema.ts@@ -158,6 +158,7 @@ export const UserConfigSchema = z.prefault({}),ai: z.looseObject({+ enabled: z.boolean().prefault(true),rules: z.string().prefault(""),max_tokens: z.number().int().positive().nullable().optional(),mode: z.enum(COPILOT_MODES).prefault("manual"),diff --git a/frontend/src/core/config/config.ts b/frontend/src/core/config/config.tsindex 5d96e697c5..54c6ecc427 100644--- a/frontend/src/core/config/config.ts+++ b/frontend/src/core/config/config.ts@@ -78,6 +78,14 @@ export const aiEnabledAtom = atom<boolean>((get) => {return isAiEnabled(get(resolvedMarimoConfigAtom));});+export const aiModelConfiguredAtom = atom<boolean>((get) => {+ return isAiModelConfigured(get(resolvedMarimoConfigAtom));+});++export const aiFeaturesEnabledAtom = atom<boolean>((get) => {+ return isAiFeatureEnabled(get(resolvedMarimoConfigAtom));+});+export const editorFontSizeAtom = atom<number>((get) => {return get(resolvedMarimoConfigAtom).display.code_editor_font_size;});@@ -87,6 +95,10 @@ export const localeAtom = atom<string | null | undefined>((get) => {});export function isAiEnabled(config: UserConfig) {+ return config.ai?.enabled !== false;+}++export function isAiModelConfigured(config: UserConfig) {return (Boolean(config.ai?.models?.chat_model) ||Boolean(config.ai?.models?.edit_model) ||@@ -94,6 +106,10 @@ export function isAiEnabled(config: UserConfig) {);}+export function isAiFeatureEnabled(config: UserConfig) {+ return isAiEnabled(config) && isAiModelConfigured(config);+}+/*** Atom for storing the app config.*/diff --git a/marimo/_config/config.py b/marimo/_config/config.pyindex fe370f3a44..51c0c61b33 100644--- a/marimo/_config/config.py+++ b/marimo/_config/config.py@@ -298,6 +298,7 @@ class AiConfig(TypedDict, total=False):**Keys.**+ - `enabled`: if `False`, hide AI actions and panels in the marimo UI- `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"`@@ -317,6 +318,7 @@ class AiConfig(TypedDict, total=False):- `open_ai_compatible`: the OpenAI-compatible config (deprecated, use custom_providers)"""+ enabled: NotRequired[bool]rules: NotRequired[str]max_tokens: NotRequired[int]mode: NotRequired[CopilotMode]@@ -758,6 +760,7 @@ DEFAULT_CONFIG: MarimoConfig = {}},"ai": {+ "enabled": True,"models": {"displayed_models": [],"custom_models": [],diff --git a/packages/openapi/api.yaml b/packages/openapi/api.yamlindex fcc994eb99..824d9b9e1c 100644--- a/packages/openapi/api.yaml+++ b/packages/openapi/api.yaml@@ -94,7 +94,8 @@ components:title: AiCompletionRequesttype: objectAiConfig:- description: "Configuration options for AI.\n\n **Keys.**\n\n - `rules`:\+ description: "Configuration options for AI.\n\n **Keys.**\n\n - `enabled`:\+ \ if `False`, hide AI actions and panels in the marimo UI\n - `rules`:\\ custom rules to include in all AI completion prompts\n - `max_tokens`:\\ the maximum number of tokens to use in AI completions\n - `mode`: the\\ mode to use for AI completions. Can be one of: `\"ask\"` or `\"manual\"\@@ -119,6 +120,8 @@ components:additionalProperties:$ref: '#/components/schemas/OpenAiConfig'type: object+ enabled:+ type: booleangithub:$ref: '#/components/schemas/GitHubConfig'google:diff --git a/packages/openapi/src/api.ts b/packages/openapi/src/api.tsindex 6aa1bd3e02..e714ddee20 100644--- a/packages/openapi/src/api.ts+++ b/packages/openapi/src/api.ts@@ -3394,6 +3394,7 @@ export interface components {** **Keys.***+ * - `enabled`: if `False`, hide AI actions and panels in the marimo UI* - `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"`@@ -3419,6 +3420,7 @@ export interface components {custom_providers?: {[key: string]: components["schemas"]["OpenAiConfig"];};+ enabled?: boolean;github?: components["schemas"]["GitHubConfig"];google?: components["schemas"]["GoogleAiConfig"];inline_tooltip?: boolean;diff --git a/tests/_server/templates/snapshots/export1.txt b/tests/_server/templates/snapshots/export1.txtindex 5212c13a60..cf76801eba 100644--- a/tests/_server/templates/snapshots/export1.txt+++ b/tests/_server/templates/snapshots/export1.txt@@ -102,7 +102,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"ai": {"custom_providers": {}, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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": {"custom_providers": {}, "enabled": true, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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.txtindex 5e8e3d9936..ec0c7b7290 100644--- a/tests/_server/templates/snapshots/export2.txt+++ b/tests/_server/templates/snapshots/export2.txt@@ -102,7 +102,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"ai": {"custom_providers": {}, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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": {"custom_providers": {}, "enabled": true, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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.txtindex 0b68b37a1a..5bb31c72b8 100644--- a/tests/_server/templates/snapshots/export3.txt+++ b/tests/_server/templates/snapshots/export3.txt@@ -102,7 +102,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"ai": {"custom_providers": {}, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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": {"custom_providers": {}, "enabled": true, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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.txtindex 75aba3a8b2..2aa36d29fb 100644--- a/tests/_server/templates/snapshots/export4.txt+++ b/tests/_server/templates/snapshots/export4.txt@@ -102,7 +102,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"ai": {"custom_providers": {}, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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": {"custom_providers": {}, "enabled": true, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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.txtindex bc0ba18f64..21658dfa72 100644--- a/tests/_server/templates/snapshots/export5.txt+++ b/tests/_server/templates/snapshots/export5.txt@@ -114,7 +114,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"ai": {"custom_providers": {}, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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": {"custom_providers": {}, "enabled": true, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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.txtindex e022478baf..5816803147 100644--- a/tests/_server/templates/snapshots/export6.txt+++ b/tests/_server/templates/snapshots/export6.txt@@ -103,7 +103,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"ai": {"custom_providers": {}, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "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": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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": {"custom_providers": {}, "enabled": true, "models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "auto_close_pairs": true, "copilot": false, "signature_hint_on_typing": false}, "diagnostics": {"sql_linter": true}, "display": {"cell_output": "below", "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": true, "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": false}}, "mcp": {"mcpServers": {}, "presets": []}, "package_management": {"manager": "uv"}, "runtime": {"auto_instantiate": false, "auto_reload": "off", "default_csv_encoding": "utf-8", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "show_tracebacks": false, "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},