-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Using GPT Pilot with Anthropic models
Note: This article is for using GPT Pilot locally via the terminal. For info on how to use your own API key via the Pythagora VS Code extension, read this article.
0 - Be sure to first follow the steps in the How to start using GPT Pilot article to setup GPT Pilot via the terminal.
1 - To use Anthropic, get an API key from the Anthropic website.
2 - If you haven't already, in your cloned GPT Pilot repo, make a copy of the example-config.json file and name it config.json.
3 - Edit the new config.json file's llm section. If you're using Anthropic via a proxy or through AWS Bedrock, you'll also need to set base_url accordingly from the default null:
"llm": {
"anthropic": {
"base_url": "https://api.anthropic.com/",
"api_key": "your-anthropic-key",
"connect_timeout": 60.0,
"read_timeout": 10.0
}
},4 - Update the agent section of the config.json file for Anthropic. Note: This is an example, you'll need to double-check the official Anthropic documentation for the most recent model info:
"agent": {
"default": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20240620",
"temperature": 0.5
},5 - That's it! Just in case, here's an example config.json file (with the API key removed):
{
"llm": {
"openai": {
"base_url": "https://api.anthropic.com/",
"api_key": "xxxxxx",
"connect_timeout": 60.0,
"read_timeout": 10.0,
"extra": null
}
},
"agent": {
"default": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20240620",
"temperature": 0.5
},
"CodeMonkey.describe_files": {
"provider": "antropic",
"model": "claude-3-5-sonnet-20240620",
"temperature": 0.0
},
"Troubleshooter.get_route_files": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20240620",
"temperature": 0.0
}
},
"prompt": {
"paths": [
"/Users/username/projects/gpt-pilot/core/prompts"
]
},
"log": {
"level": "DEBUG",
"format": "%(asctime)s %(levelname)s [%(name)s] %(message)s",
"output": "pythagora.log"
},
"db": {
"url": "sqlite+aiosqlite:///pythagora.db",
"debug_sql": false
},
"ui": {
"type": "plain"
},
"fs": {
"type": "local",
"workspace_root": "/Users/username/projects/gpt-pilot/workspace",
"ignore_paths": [
".git",
".gpt-pilot",
".idea",
".vscode",
".next",
".DS_Store",
"__pycache__",
"site-packages",
"node_modules",
"package-lock.json",
"venv",
".venv",
"dist",
"build",
"target",
"*.min.js",
"*.min.css",
"*.svg",
"*.csv",
"*.log",
"go.sum",
"migration_lock.toml"
],
"ignore_size_threshold": 50000
}
}