Visual Studio Code配置Ollama


1. 安装Ollama

1.1 下载Ollama

https://ollama.com/

1.2 使用终端下载模型

ollama pull gemma2:9b   
ollama pull llama3.1:8b
ollama pull llama3.2:3b
ollama pull qwen2.5:7b
ollama pull qwen2.5:3b
ollama pull gemma2:2b

2. 安装Visual Studio Code

2.1 下载Visual Studio Code

https://code.visualstudio.com/

2.2.Visual Studio Code安装Continue 插件

2.3 配置插件config

{
  "models": [
    {
      "title": "Llama 3.1 8B",
      "provider": "ollama",
      "model": "llama3.1:8b"
    },
    {
      "title": "llama3.2:3b",
      "provider": "ollama",
      "model": "llama3.2:3b"
    },
    {
      "title": "qwen2.5:7b",
      "provider": "ollama",
      "model": "qwen2.5:7b"
    },
    {
      "title": "qwen2.5:3b",
      "provider": "ollama",
      "model": "qwen2.5:3b"
    },
    {
      "title": "gemma2:2b",
      "provider": "ollama",
      "model": "gemma2:2b"
    },
    {
      "title": "gemma2:9b",
      "provider": "ollama",
      "model": "gemma2:9b"
    },
  ],
  "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"
    }
  ],
}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注