Skip to main content
marimo provides sophisticated code completion capabilities to help you write code faster and with fewer errors. The editor combines traditional code completion with AI-powered suggestions to provide an intelligent coding experience.

Completion Features

marimo’s completion engine integrates multiple sources to provide comprehensive suggestions:
  • Jedi: Fast, accurate Python code completion for standard library and third-party packages
  • Variable completion: Context-aware completion of variables defined in your notebook
  • AI-powered completion: Inline suggestions using GitHub Copilot, Codeium, or custom models
  • Language Server Protocol (LSP): Enhanced completions from pylsp and other language servers

Basic Code Completion

Code completion activates automatically as you type, suggesting:
  • Variable names from your notebook cells
  • Module and package names
  • Function and method names
  • Class attributes and methods
  • Keywords and built-in functions
Press Tab or Ctrl/Cmd+Space to manually trigger completions at any time.

Signature Hints

When calling functions, marimo displays signature hints showing parameter names, types, and default values. This helps you understand function APIs without leaving your code.
You can control when signature hints appear:
marimo.toml
[completion]
activate_on_typing = true           # Auto-show completions while typing
signature_hint_on_typing = false    # Only show hints on manual trigger
Or configure through the editor settings menu.

AI-Powered Completions

marimo supports AI copilots that provide intelligent, context-aware code suggestions as you type, similar to GitHub Copilot in VS Code.

GitHub Copilot

The marimo editor natively supports GitHub Copilot, an AI pair programmer that suggests entire lines or blocks of code. Setup:
  1. Install Node.js (required for the Copilot language server)
  2. Enable Copilot via the settings menu in the marimo editor
  3. Authenticate with your GitHub account when prompted
GitHub Copilot is not yet available in the conda distribution. Please install marimo using pip or uv if you need Copilot support.
Advanced Configuration: Customize GitHub Copilot behavior in your marimo.toml:
marimo.toml
[completion]
copilot = "github"

[ai.github.copilot_settings.http]
proxy = "http://proxy.example.com:8888"
proxyStrictSSL = true

[ai.github.copilot_settings.github-enterprise]
uri = "https://github.enterprise.com"  # For GitHub Enterprise users
Available settings:
  • HTTP settings: Configure proxy for network connections
  • Telemetry: Control telemetry data collection ("off", "crash", "error", or "all")
  • GitHub Enterprise: Configure your enterprise server URL
See the AI completion guide for more details.

Codeium (Windsurf)

Windsurf (formerly Codeium) provides fast, free AI-powered code completions. Setup:
  1. Sign up at windsurf.com
  2. Download and install the Windsurf app
  3. Copy your API key from the Windsurf app (Cmd/Ctrl+Shift+P → “Copy API Key”)
  4. Configure in marimo settings or add to your config:
marimo.toml
[completion]
copilot = "codeium"
codeium_api_key = "your-api-key-here"

Custom Copilot Models

You can integrate custom LLM providers for code completion, allowing you to use internal providers, local models (e.g., Ollama), or any OpenAI-compatible service.
marimo.toml
[ai.models]
autocomplete_model = "provider/model-name"  # e.g., "ollama/codellama"

[completion]
copilot = "custom"
This enables inline code suggestions using:
  • Local models via Ollama
  • Internal company LLM services
  • OpenAI, Anthropic, Google with your own API keys
  • Any OpenAI-compatible provider
See the LLM providers guide for provider-specific configuration.

Language Server Integration

marimo integrates with Python language servers to enhance code completion with type information, documentation, and more intelligent suggestions.

Python LSP Server (pylsp)

The Python Language Server Protocol implementation provides:
  • Context-aware completions
  • Type-based suggestions
  • Documentation on hover
  • Code actions and quick fixes
Install:
pip install "marimo[lsp]"
# or
uv add "marimo[lsp]"
Enable in configuration:
pyproject.toml
[tool.marimo.language_servers.pylsp]
enabled = true
See the Language Server guide for complete LSP documentation.

Completion Configuration

Configuration File

Edit your marimo.toml to customize completion behavior:
marimo.toml
[completion]
activate_on_typing = true           # Show completions while typing
signature_hint_on_typing = false    # Only show signature on manual trigger
copilot = "github"                  # Options: false, "github", "codeium", "custom"

Via Settings Menu

Access completion settings through:
  1. Open settings (⚙️ icon in top-right)
  2. Navigate to “Completion” tab
  3. Adjust settings visually
Settings configured in pyproject.toml or script metadata take precedence over user configuration and cannot be changed through the UI.

Completion Shortcuts

Key bindings for completion:
ActionDefault Shortcut
Trigger completionTab or Ctrl/Cmd+Space
Accept suggestionTab or Enter
Next suggestion or Ctrl+n
Previous suggestion or Ctrl+p
DismissEsc
Customize these shortcuts in the hotkeys settings.

Best Practices

Descriptive names help the completion engine provide better suggestions and make your code more maintainable.
# Good - clear, descriptive names
user_dataframe = load_user_data()
filtered_users = user_dataframe[user_dataframe['age'] > 18]

# Less helpful for completion
df = load_data()
df2 = df[df['age'] > 18]
Type annotations improve completion accuracy, especially with LSP enabled:
from typing import List

def process_data(items: List[dict]) -> pd.DataFrame:
    # Completions will know 'items' is a list of dicts
    return pd.DataFrame(items)
Import packages in cells where you use them for better completion context:
import pandas as pd
import numpy as np

# Completions will work better here
df = pd.DataFrame(np.random.randn(10, 3))

Troubleshooting

  1. Check that activate_on_typing is enabled in settings
  2. Try manually triggering with Ctrl/Cmd+Space
  3. Verify Jedi is installed: pip list | grep jedi
  4. Restart the marimo server
  1. Ensure Node.js is installed: node --version
  2. Check authentication status in settings
  3. Verify network connectivity (Copilot requires internet)
  4. Check logs in ~/.cache/marimo/logs/ for errors
  1. Disable LSP if not needed: Set enabled = false for language servers
  2. Reduce signature hints: Set signature_hint_on_typing = false
  3. Check for large imported modules that may slow analysis

Build docs developers (and LLMs) love