Skip to main content
Kilocode is a powerful VSCode extension that provides AI-powered code completion, inline chat, and code actions. Configure it to use MegaLLM for access to multiple AI models.

Quick Configuration

Step-by-Step Setup

1

Open VSCode Settings

  • Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
  • Type: Preferences: Open Settings (UI)
  • Search for: Kilocode
2

Configure API Provider

  • API Provider: Select Custom
  • Provider Name: MegaLLM
  • Base URL: https://ai.megallm.io/v1
  • API Key: sk-mega-your-api-key-here
3

Select Default Model

  • Default Model: gpt-5 (or any supported model)
  • Temperature: 0.3 (lower = more deterministic)
  • Max Tokens: 500 (for completions)
4

Enable Features

  • Enable AutoComplete
  • Enable Inline Chat
  • Enable Code Actions
  • Enable Suggestions

Scenario Examples

Scenario 1: First-Time Installation

Complete setup from scratch:
1

Install Kilocode Extension

  1. Open VSCode
  2. Go to Extensions: Ctrl+Shift+X / Cmd+Shift+X
  3. Search: Kilocode
  4. Click Install
  5. Reload VSCode window
2

Get MegaLLM API Key

  1. Visit MegaLLM Dashboard
  2. Navigate to API Keys section
  3. Click Create New Key
  4. Copy the key (starts with sk-mega-)
  5. Store it securely
3

Configure Extension

Open settings (Ctrl+, / Cmd+,) and add:
4

Test Configuration

  1. Create a new file: test.js
  2. Type a comment: // function to calculate fibonacci
  3. Press Tab to trigger completion
  4. Should see AI-generated code
Expected Result:

Scenario 2: Team Project Configuration

Set up Kilocode for entire development team: Project Structure:
Step 1: Create Shared Config .vscode/settings.json (committed to git):
Step 2: Setup .gitignore
Step 3: Create Setup Instructions README.md:
Add to your shell config (~/.bashrc or ~/.zshrc) to persist.
  1. Or create local settings (not committed): .vscode/settings.local.json:
  2. Reload VSCode and start coding!

Verification

Type // hello world function and press Tab. Should see AI-generated code.

Scenario 3: Project-Specific Model Selection

Use different models for different projects: Python Data Science Project: .vscode/settings.json:
JavaScript/React Project: .vscode/settings.json:
Systems Programming (Rust/Go): .vscode/settings.json:

Scenario 4: Multi-Model Workflow

Switch models dynamically based on task: Configuration:
Usage:
  • Morning (rapid prototyping): Use fast profile with GPT-4o-mini
  • Afternoon (quality code): Use quality profile with Claude Opus
  • Documentation: Use creative profile with higher temperature
Switch profiles via Command Palette:
  1. Ctrl+Shift+P / Cmd+Shift+P
  2. Kilocode: Switch Model Profile
  3. Select: fast, quality, or creative

Scenario 5: Migration from GitHub Copilot

Switching from Copilot to Kilocode with MegaLLM: Current Setup (Copilot):
New Setup (Kilocode + MegaLLM):
1

Disable Copilot

2

Install Kilocode

VSCode Extensions → Search “Kilocode” → Install
3

Configure MegaLLM

4

Compare Experience

Benefits over Copilot:
  • Access to multiple models (GPT, Claude, Gemini)
  • Better pricing and no seat limits
  • Inline chat for explanations
  • Custom model selection per project
  • Code actions beyond completion

Configuration Options

Complete Reference

Model Selection Guide

See full model catalog for all options.

Verification

Test 1: Basic Completion

Test 2: Inline Chat

  1. Select a function
  2. Press Ctrl+K (or Cmd+K on Mac)
  3. Type: Explain this function
  4. Should see explanation in chat panel

Test 3: Code Actions

  1. Right-click on code
  2. Should see “Kilocode Actions” in context menu
  3. Options: Explain, Improve, Generate Tests, etc.

Test 4: Status Bar

Check bottom-right of VSCode:
  • Should show: Kilocode: Connected
  • Model name: gpt-5 (or your selected model)
  • Click to see connection details

Troubleshooting

Symptoms:
  • No suggestions when typing
  • Status bar shows “Disconnected”
Solutions:
  1. Check API key:
  2. Verify configuration:
  3. Reload VSCode:
    • Ctrl+Shift+P / Cmd+Shift+P
    • Run: Developer: Reload Window
  4. Check extension is enabled:
    • Extensions panel
    • Search: Kilocode
    • Should show “Enabled”
  5. Test API manually:
Symptoms:
  • Completions are incorrect
  • Suggestions don’t match code style
  • Irrelevant responses
Solutions:
  1. Adjust temperature:
  2. Try different model:
  3. Increase context:
  4. Add project-specific prompt:
Symptoms:
  • Long wait for suggestions
  • Timeout errors
Solutions:
  1. Use faster model:
  2. Reduce max tokens:
  3. Increase debounce delay:
  4. Check network:
Symptoms:
  • “Invalid API key” error
  • 401 Unauthorized
Solutions:
  1. Verify key format:
    • Must start with sk-mega-
    • At least 60 characters
    • No spaces or quotes
  2. Check key is active:
    • Login to Dashboard
    • Go to API Keys
    • Verify key is not revoked/expired
  3. Test key directly:
  4. Regenerate if needed:
    • Dashboard → API Keys → Create New
    • Update configuration with new key
Symptoms:
  • Kilocode completions conflict with other AI tools
  • Multiple suggestions appearing
Solutions:
  1. Disable conflicting extensions:
  2. Adjust trigger keys:
  3. Set priority:

Best Practices

Use Environment Variables

Keep API keys in env vars, reference with ${env:MEGALLM_API_KEY}

Project-Specific Models

Configure different models in .vscode/settings.json per project

Lower Temperature for Code

Use 0.2-0.4 for code generation, 0.7-0.9 for documentation

Monitor Token Usage

Check Dashboard to optimize costs

Advanced Tips

Custom Keyboard Shortcuts

Add to keybindings.json:

Workspace-Specific Prompts

.vscode/settings.json:

Context-Aware Completions

Next Steps

RooCode Setup

Configure RooCode application

Cline Setup

Configure Cline VSCode extension

Models Catalog

Browse all available models

Other Agents

View all CLI and GUI agents

API Reference

Explore the API docs

Discord Community

Join for support