Skip to content

Instantly share code, notes, and snippets.

@pitzcarraldo
Last active October 1, 2024 08:06
Show Gist options
  • Save pitzcarraldo/8c538d287a6d575800c9fcad1238c12c to your computer and use it in GitHub Desktop.
Save pitzcarraldo/8c538d287a6d575800c9fcad1238c12c to your computer and use it in GitHub Desktop.
continue.dev config.json free edition

continue.dev config.json free edition

Purpose

Continue.dev itself is already free and open-sourced. However, to use it, you'll need API keys to access various providers, many of which are paid services.

While you can run models locally using Ollama, doing so requires a powerful machine with a GPU, which typically comes at a high cost. Additionally, models that can be run locally with ease typically have fewer parameters and are lighter, resulting in lower performance compared to API-provided models.

Fortunately, Google Gemini offers free quotas if you agree to allow the use of your usage data. Additionally, Mistral provides free Codestral API access, which can be used for auto-completion.

This config.json file is preset to use these free services with continue.dev, so you don't need to pay to use it. An important aspect is the embeddingsProvider setting. The default setting is not compatible with JetBrains' IDEs. Therefore, we use Google's text-embedding-004 model to ensure that this configuration works seamlessly with both VSCode and JetBrains IDEs.

Usage

  1. Obtain Your API Keys:

    • Get your Google Gemini API key from this link. (Account required.)
    • Get your Codestral API key from this link. (Account required.)
  2. Install the Extension in Your IDE:

  3. Configure config.json:

    • Overwrite your existing config.json with the provided configuration below. The default location is ~/.continue/config.json.
  4. Restart Your IDE:

    • After updating the config.json, restart your IDE to apply the changes.

config.json

{
  "models": [
    {
      "title": "Gemini 1.5 Flash",
      "model": "gemini-1.5-flash-latest",
      "provider": "gemini",
      "apiKey": "your-gemini-api-key (see above)"
    },
    {
      "title": "Gemini 1.5 Flash 002",
      "model": "gemini-1.5-flash-002",
      "provider": "gemini",
      "apiKey": "your-gemini-api-key (see above)"
    },
    {
      "title": "Gemini 1.5 Pro",
      "model": "gemini-1.5-pro-latest",
      "provider": "gemini",
      "apiKey": "your-gemini-api-key (see above)"
    },
    {
      "title": "Gemini 1.5 Pro 002",
      "model": "gemini-1.5-pro-002",
      "provider": "gemini",
      "apiKey": "your-gemini-api-key (see above)"
    },
    {
      "title": "Codestral",
      "provider": "mistral",
      "model": "codestral-latest",
      "apiKey": "your-codestral-api-key (see above)"
    }
  ],
  "embeddingsProvider": {
    "model": "models/text-embedding-004",
    "provider": "gemini",
    "apiKey": "your-gemini-api-key (see above)"
  },
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": "your-codestral-api-key (see above)"
  },
  "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": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ]
}

Disclaimer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment