> For the complete documentation index, see [llms.txt](https://djthorpe.gitbook.io/go-llm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://djthorpe.gitbook.io/go-llm/installation.md).

# Installation

go-llm runs as a server, with its web UI, best with Docker. The `llm` command is its command-line client.

{% hint style="warning" %}
**Don't run go-llm on the internet.** It has no authentication yet. Publish its port on `localhost` only, or put it behind a proxy that signs people in, or a VPN.
{% endhint %}

## Run go-llm with Docker

The image has the server and its web UI, and keeps its data in the `/data` volume.

```bash
docker volume create llm

docker run -d --name llm -p 127.0.0.1:8084:8084 -v llm:/data \
  -e OLLAMA_ADDR=http://host.docker.internal:11434 \
  -e OPENAI_API_KEY \
  ghcr.io/mutablelogic/llm
```

Then open <http://localhost:8084/>.

* **`host.docker.internal`** is the machine Docker runs on, such as for a local Ollama. Docker Desktop has it. On Linux, add `--add-host=host.docker.internal:host-gateway`.
* **On first start,** go-llm adds a provider for each of these which is set:
  * `OLLAMA_ADDR`, `LMSTUDIO_ADDR` and `GOWHISPER_ADDR`, as URLs;
  * `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `DEEPSEEK_API_KEY`, `MISTRAL_API_KEY` and `ELEVENLABS_API_KEY`.
* **Keys** are read from the environment when they're used, and never stored.
* **Eliza,** a mock chatbot for testing, is added too, unless `NO_ELIZA` is set.
* **`UID` and `GID`** set the user it runs as, such as the owner of a mounted `/data` directory.

### Docker Compose

The [compose file](https://github.com/mutablelogic/go-llm/blob/main/docker/compose.yaml) lists every variable the server reads. Two profiles add servers whose models go-llm can use:

* **`ollama`:** an Ollama server. Set `OLLAMA_ADDR` too.
* **`whisper`:** a [go-whisper](https://github.com/mutablelogic/go-whisper) server, which transcribes speech. Set `GOWHISPER_ADDR` too.

```bash
OLLAMA_ADDR=http://ollama:11434 GOWHISPER_ADDR=http://whisper:8081 \
  docker compose -f docker/compose.yaml --profile ollama --profile whisper up -d
```

## Without Docker

```bash
go install github.com/mutablelogic/go-llm/cmd/llm@latest
llm run
```

* **The server** listens on `localhost:8084`, and keeps its data in your cache directory.
* **No web UI:** installed this way, it serves only the API, under `/api`. Run `make` in a clone to build both, with npm, into `build/llm`.

## Install the command-line tool

The web UI is all you need to chat. The `llm` command is for the terminal, and for automation, such as scripts, cron jobs and CI.

```bash
go install -tags client github.com/mutablelogic/go-llm/cmd/llm@latest
```

* **Go:** it needs Go 1.21 or later, which downloads the toolchain go.mod asks for, unless `GOTOOLCHAIN=local` is set.
* **The server:** it connects to `localhost:8084`, or the server at `--http.addr`, or `LLM_ADDR`, such as `LLM_ADDR=nas.local:8084`.

Next, see [Getting Started](/go-llm/getting-started.md), to add providers, and start a conversation.


---

# 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://djthorpe.gitbook.io/go-llm/installation.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.
