| 1 | --- |
| 2 | title: "Llama.cpp" |
| 3 | description: "Configure Llama.cpp with Continue to run local language models using high-performance C++ inference, including setup instructions for the server and client configuration" |
| 4 | --- |
| 5 | |
| 6 | Run the llama.cpp server binary to start the API server. If running on a remote server, be sure to set host to 0.0.0.0: |
| 7 | |
| 8 | ```bash |
| 9 | .\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models\meta\llama\codellama-7b-instruct.Q8_0.gguf |
| 10 | ``` |
| 11 | |
| 12 | After it's up and running, change `~/.continue/config.json` to look like this: |
| 13 | |
| 14 | <Tabs> |
| 15 | <Tab title="YAML"> |
| 16 | ```yaml title="config.yaml" |
| 17 | models: |
| 18 | - name: Llama CPP |
| 19 | provider: llama.cpp |
| 20 | model: MODEL_NAME |
| 21 | apiBase: http://localhost:8080 |
| 22 | ``` |
| 23 | </Tab> |
| 24 | <Tab title="JSON"> |
| 25 | ```json title="config.json" |
| 26 | { |
| 27 | "models": [ |
| 28 | { |
| 29 | "title": "Llama CPP", |
| 30 | "provider": "llama.cpp", |
| 31 | "model": "MODEL_NAME", |
| 32 | "apiBase": "http://localhost:8080" |
| 33 | } |
| 34 | ] |
| 35 | } |
| 36 | ``` |
| 37 | </Tab> |
| 38 | </Tabs> |
| 39 | |
| 40 | [View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/LlamaCpp.ts) |