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

# Ollama

Integrating with a local Ollama server for on-device AI

[Ollama](https://ollama.com/) is a popular tool for running AI models locally. It runs a local web server that can be accessed via other tools.

### Allowlisting Ollama Requests from Chrome Extensions

By default, Ollama only allows requests from `127.0.0.1` and `0.0.0.0` . To enable access from PixieBrix, set the `OLLAMA_ORIGINS` configuration variable:

```
OLLAMA_ORIGINS=chrome-extension://*
```

For more information, refer to the Ollama documentation:

* [How can I allow additional web origins to access Ollama?](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-allow-additional-web-origins-to-access-ollama)
* [How do I configure Ollama Server?](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server)

### Making Ollama Requests

Ollama makes API models available via a local HTTP server. Therefore, you can use PixieBrix's standard request bricks:

* `HTTP Request`
* `[Experimental] Streaming HTTP Request`

For a full list of available methods, refer to [Ollama REST API Documentation](https://github.com/ollama/ollama/blob/main/docs/api.md)

#### Response Streaming

By default, Ollama's `/generate`and `/chat` methods stream the response. To disable streaming, include `stream: false` in the request data.

### Frequently Asked Questions

#### I receive a `403 Forbidden` error when trying to access the Ollama server from PixieBrix

Ensure the `OLLAMA_ORIGINS` variable is set and that the Ollama server has read the configuration variable. See [#allowlisting-access-from-chrome-extensions](#allowlisting-access-from-chrome-extensions "mention")


---

# 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://docs.pixiebrix.com/integrations/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.
