Skip to content

Code Completions ✨

Supercharge your coding workflow with Flexpilot's AI-powered code completions. This guide covers everything you need to know about configuring and customizing the completion models to enable code suggestion while you type.

🎁 Free Getting Started

Get started instantly with Codestral's generous free tier! Their codestral-latest model provides high-quality completions without any payment required.

Setting Up Your Model

Flexpilot supports multiple AI providers that are compatible with the OpenAI API format, including OpenAI Instruct Models, Mistral AI (Codestral), Ollama, and other OpenAI-compatible providers. To configure your preferred provider, follow these steps:

  1. Open the command palette:

    • Windows/Linux: Ctrl + Shift + P
    • macOS: Cmd + Shift + P
  2. Search for Flexpilot: Configure the Language Model Provider

  3. Select Edit Completions Config

📝 Configuration Fields Explained
FieldDescriptionRecommended Value
API Base URLProvider's API endpointhttps://api.openai.com/v1 or https://codestral.mistral.ai/v1/fim
API KeyYour authentication keyObtain from provider
Model IDSpecific model identifiergpt-3.5-turbo-instruct or codestral-latest
Max Output TokensMaximum generated tokens500
Max Input TokensMaximum context window4000 (model context - output tokens)
TemperatureOutput randomness (0-1)0.2
Debounce WaitDelay before completion (ms)200-500

⚠️ Important

Keep your API keys secure and never commit them to version control!

Managing Completions

Status Indicator

The Flexpilot logo in the bottom-right corner shows the current completion status:

  • 🔄 Spinning: Fetching completions
  • ⚡ Normal: Ready for next completion

Enable / Disable

To control code completions, click the Flexpilot icon in the bottom-right corner of the editor. This opens the Quick Controls menu, where you can toggle completions globally or for specific languages.

Quick Controls

  • Global Toggle: Enable/disable completions across all workspaces
  • Language Settings: Toggle completions for the current file type

TIP

You can quickly disable completions for specific languages while keeping them enabled globally. This is useful when you want to temporarily turn off suggestions for certain file types.