> For the complete documentation index, see [llms.txt](https://docs.valohai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valohai.com/genai/llm-evaluations-local-execution.md).

# Offline LLM Evaluations with LLM Eval

Evaluate large language models from your own environment and analyze the results in Valohai LLM.

The tool is built for teams who want structured multi-model evaluation, clear comparison across models and datasets, metrics that mean something to their business, and a path to the Valohai platform when the runs outgrow a laptop.

## How it works

Your evaluation logic stays yours. You decide which models are tested, which samples they run against, how metrics are computed, and what the numbers mean.

The `valohai-llm` Python library runs the evaluation wherever your code runs and reports what it measured. The interface at [llm.valohai.com](https://llm.valohai.com) holds the datasets and task configuration your script reads, and the views you read the results in. [Conduit](https://docs.valohai.com/genai/tracking-llm-api-costs-with-conduit.md), the proxy, is optional and adds what every LLM call cost.

A full evaluation is four steps, each with its own page:

1. [Organizing your evaluations with Datasets](https://docs.valohai.com/genai/llm-evaluations-local-execution/organizing-your-evaluations-with-datasets.md). A dataset is your benchmark, a versioned collection of samples. Locking a version makes a result reproducible.
2. [Configuring your evaluations with Tasks](https://docs.valohai.com/genai/llm-evaluations-local-execution/configuring-your-evaluations-with-tasks.md). A task is what to test: the parameter values to sweep and the dataset versions to sweep them over.
3. [Running your evaluations with valohai-llm](https://docs.valohai.com/genai/llm-evaluations-local-execution/running-your-evaluations-with-valohai-llm.md). Post results one at a time, or hand the library your evaluation function and let it run the whole sweep.
4. [Analyzing and comparing results](https://docs.valohai.com/genai/llm-evaluations-local-execution/analyzing-and-comparing-results.md). Group, filter, and compare configurations, then settle the decision in [Comparing cost and quality](https://docs.valohai.com/genai/llm-evaluations-local-execution/comparing-cost-and-quality.md).

## Sign in and create a workspace

Go to [llm.valohai.com](https://llm.valohai.com) and sign in with Google, GitHub, or your Valohai account where your organization has that enabled.

Everything belongs to a workspace: datasets, tasks, results, and API tokens. Create one on first sign-in.

If your organization runs its own Valohai LLM instance, use its address instead and point the library at it with `VALOHAI_LLM_URL`. Everything else works the same way. Talk to your Valohai contact about deployment.

## Install and authenticate

```shell
pip install valohai-llm
```

With `uv`:

```shell
uv pip install valohai-llm   # pip-compatible project
uv add valohai-llm           # uv-managed project
```

Generate an API token on the Setup page of your workspace and put it in the environment:

```shell
export VALOHAI_LLM_API_KEY="your-token"
```

## Your first result

Enough to prove the loop works. This needs no dataset and no task configured in advance:

```python
import valohai_llm

valohai_llm.post_result(
    task="my-first-evaluation",
    labels={"model": "gpt-4o"},
    metrics={"accuracy": 0.85, "latency_ms": 150},
)
```

Open Results and it is there. A task named `my-first-evaluation` was created to hold it.

From here, [Running your evaluations with valohai-llm](https://docs.valohai.com/genai/llm-evaluations-local-execution/running-your-evaluations-with-valohai-llm.md) covers posting from a real evaluation and sweeping parameters with `task.run()`.

## Typical LLM evaluation patterns

| Pattern                     | Description                                                        |
| --------------------------- | ------------------------------------------------------------------ |
| Multi-provider comparison   | OpenAI against Anthropic against a self-hosted model               |
| Prompt testing              | Compare prompt versions on a fixed set of samples                  |
| Cost against quality        | Find the cheapest configuration that still clears your quality bar |
| Routing validation          | Check that a cheap model handles the samples you route to it       |
| Pre-production benchmarking | Settle a change offline before it ships                            |

## Scaling further with Valohai

The evaluation tool is deliberately light. When the work outgrows it, the Valohai platform adds dataset versioning and lineage, large parallel sweeps, recurring evaluation jobs, pipelines and orchestration, training and fine-tuning, and hybrid or multi-cloud execution.

Evaluations stay fast and local. The platform handles orchestration, governance, and infrastructure.

## Next steps

* [Organizing your evaluations with Datasets](https://docs.valohai.com/genai/llm-evaluations-local-execution/organizing-your-evaluations-with-datasets.md)
* [Configuring your evaluations with Tasks](https://docs.valohai.com/genai/llm-evaluations-local-execution/configuring-your-evaluations-with-tasks.md)
* [Running your evaluations with valohai-llm](https://docs.valohai.com/genai/llm-evaluations-local-execution/running-your-evaluations-with-valohai-llm.md)
* [Analyzing and comparing results](https://docs.valohai.com/genai/llm-evaluations-local-execution/analyzing-and-comparing-results.md)
* [Comparing cost and quality](https://docs.valohai.com/genai/llm-evaluations-local-execution/comparing-cost-and-quality.md)
* [Showing full traces of LLM calls with Langfuse](https://docs.valohai.com/genai/llm-evaluations-local-execution/showing-full-traces-of-llm-calls-with-langfuse.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://docs.valohai.com/genai/llm-evaluations-local-execution.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.
