> ## Documentation Index
> Fetch the complete documentation index at: https://emartai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ollama

> Configure evalflow to run evals locally using Ollama — no API key required.

Use Ollama when you want to run evals entirely on your own machine without sending data to an external API. Ollama runs models locally, so it works offline and requires no API key or billing account.

It is useful for local development, demos, air-gapped environments, and teams that want to avoid external model calls during iteration.

<Note>Ollama requires [Ollama](https://ollama.com) to be installed and running on your machine before you can use it with evalflow. Pull the model you intend to use with `ollama pull <model>` before running evals.</Note>

## Configure evalflow\.yaml

Add an `ollama` block under `providers`. Because Ollama runs locally, you still set `api_key_env` in the config — but you do not need to export a real key. The field must be present for evalflow to validate your config:

```yaml theme={null}
providers:
  ollama:
    api_key_env: "OLLAMA_API_KEY"
    default_model: "llama3.2"

eval:
  default_provider: "ollama"
```

<Warning>Even though Ollama does not require an API key, evalflow's config schema requires the `api_key_env` field. Set the environment variable to any non-empty placeholder value so `evalflow doctor` passes its check.</Warning>

## Set the placeholder environment variable

```bash theme={null}
export OLLAMA_API_KEY="local"
```

## Start the Ollama server

evalflow communicates with Ollama over its local HTTP server. Start it before running any evals:

```bash theme={null}
ollama serve
```

Leave this running in a separate terminal, or run it as a background service.

## Verify the connection

Run `evalflow doctor` with the `--check-providers` flag to confirm evalflow can reach the local Ollama server:

```bash theme={null}
evalflow doctor --check-providers
```

```text theme={null}
✓ ollama health check
```

## Run evals

```bash theme={null}
evalflow eval --provider ollama
```

```text theme={null}
Running test cases against llama3.2...
Quality Gate: PASS
```

If `eval.default_provider` is already set to `ollama` in your `evalflow.yaml`, you can omit the `--provider` flag:

```bash theme={null}
evalflow eval
```

## Provider notes

* **Default model:** `llama3.2`. You can set `default_model` to any model you have pulled with `ollama pull`.
* **Offline support:** Once a model is pulled, evals run fully offline. No network connection is required.
* **No billing:** Ollama is free and open source. There are no API costs or rate limits.
* **Performance:** Inference speed depends on your hardware. Running large models on CPU will be significantly slower than GPU-accelerated hardware.
* **Judge model:** By default, evalflow uses Groq as the LLM judge, which requires network access. To keep everything local, configure Ollama as the judge provider too:

```yaml theme={null}
judge:
  provider: "ollama"
  model: "llama3.2"
```

<Tip>For a fully offline eval pipeline, set both `eval.default_provider` and `judge.provider` to `ollama`.</Tip>
