> For the complete documentation index, see [llms.txt](https://burp-ai-agent.six2dez.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://burp-ai-agent.six2dez.com/backends/ollama.md).

# Ollama (Local)

Ollama is the recommended local backend when privacy constraints prevent cloud usage.

## Requirements

* Ollama installed.
* At least one model pulled locally.

## Setup

1. Install Ollama from [ollama.com](https://ollama.com).
2. Pull a model:

```bash
ollama pull qwen2.5:14b-instruct
```

3. Start server:

```bash
ollama serve
```

4. Configure in **AI Backend** settings tab.

## Configuration

| Setting                | Value                                                               |
| ---------------------- | ------------------------------------------------------------------- |
| **Preferred Backend**  | `ollama`                                                            |
| **Ollama CLI Command** | `ollama run llama3.1` (default; used for validation/model fallback) |
| **Ollama URL**         | `http://127.0.0.1:11434`                                            |
| **Ollama Model**       | `llama3.1` by default; e.g. `qwen2.5:14b-instruct`                  |
| **Ollama API Key**     | optional                                                            |
| **Ollama Headers**     | optional                                                            |
| **Ollama Auto-Start**  | optional (`ollama serve`)                                           |

## Notes

The active backend path is HTTP-based. The CLI command is used for validation and as a fallback model source when the explicit Ollama model is blank.

## Output Token Limits

The extension now sets `num_predict` automatically per request type. Previously, Ollama defaulted to 128 tokens, which caused truncated responses. Current values:

| Request Type                 | `num_predict` |
| ---------------------------- | ------------- |
| **Chat**                     | 4096          |
| **Scanner (single request)** | 2048          |
| **Scanner (batch analysis)** | 4096          |
| **Payload generation**       | 1024          |

## Troubleshooting

{% hint style="info" %}

* Empty responses: run `ollama list` and verify model exists.
* Connection issues: confirm server process and URL.
* Slow output: reduce model size on limited hardware.
  {% endhint %}

## Retry Behavior

If a request to Ollama throws a classified transient transport exception (for example, connection timeout/refused), the extension makes up to 6 total attempts. The five possible retry delays are 500/1000/1500/2000/3000 ms. Each retry is logged in the [AI Request Logger](https://burp-ai-agent.six2dez.com/privacy-and-logging/ai-request-logger.md) with the attempt number and delay. The connection's circuit breaker opens after 5 recorded transient failures and allows one half-open model request after 30 seconds — see [Backends Overview → Retry Behavior](https://burp-ai-agent.six2dez.com/backends/overview.md#retry-behavior).

## Related Pages

* [Backends Overview](https://burp-ai-agent.six2dez.com/backends/overview.md)
* [Troubleshooting](https://burp-ai-agent.six2dez.com/reference/troubleshooting.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://burp-ai-agent.six2dez.com/backends/ollama.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
