Skip to main content

How do setup a local & offline GitHub Copilot alternative

Ollama + Continue Dev

  1. Install ollama
  2. Install the continue.dev Plugin for JetBrains or VSCode
  3. Optionally, use OpenWebUI via Docker as an Interface for Chatting

Model Setup

  1. Quick Tab Completion
    ollama pull qwen2.5-coder
  2. Indexing and Codebase Search
    ollama pull nomic-embed-text
  3. General Purpose Reasoning Model
    ollama pull phi4
  4. Update continue.dev config.json -> see here
  5. Run ollama api locally
    ollama serve

Usage

Use directly in your editor

continue-in-editor.png

or via the chat-sidebar tab

continue-chat-sidebar.png

Suggested continue.dev config

  • Unix: ~/.continue/config.json
  • Windows: %USERPROFILE%\.continue\config.json
~/.continue/config.json
{
"models": [
{
"title": "PHi-4",
"provider": "ollama",
"model": "phi4",
"systemMessage": "You are a helpful assistant supporting a software developer. Your tasks may involve explaining technical concepts, assisting with code, offering best practices, and solving programming-related issues across various languages and frameworks. Always provide clear, concise, and accurate answers. Always respond in English."
}
],
"tabAutocompleteModel": {
"title": "Qwen2.5-Coder",
"provider": "ollama",
"model": "qwen2.5-coder"
},
"embeddingsProvider": {
"title": "Nomic Embed Text",
"provider": "ollama",
"model": "nomic-embed-text"
},
"customCommands": [
{
"name": "test",
"prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
"description": "Write unit tests for highlighted code"
}
],
"contextProviders": [
{
"name": "diff",
"params": {}
},
{
"name": "folder",
"params": {}
},
{
"name": "codebase",
"params": {}
},
{
"name": "file",
"params": {}
},
{
"name": "code",
"params": {}
},
{
"name": "currentFile",
"params": {}
},
{
"name": "terminal",
"params": {}
},
{
"name": "open",
"params": {}
},
{
"name": "web",
"params": {}
},
{
"name": "url",
"params": {}
},
{
"name": "repo-map",
"params": {}
},
{
"name": "os",
"params": {}
}
],
"slashCommands": [
{
"name": "share",
"description": "Export the current chat session to markdown"
},
{
"name": "commit",
"description": "Generate a git commit message"
}
]
}