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

> ## Agent Instructions
> Tokios exposes private local models through https://api.tokios.com using an outbound-only connector tunnel.
> Use 'connector' for the local tokios-connector process.
> Use 'deployment' for the public model name in the API model field.
> Use 'upstream model id' for the model served by Ollama, llama.cpp, vLLM, LM Studio, or another local backend.
> API keys use the prefix sk-tok-. Connector tokens use the prefix ct-tok-.

# Connect LobeChat to your own local model

> Add Tokios as an OpenAI provider in LobeChat — in the app or via environment variables — so a polished chat UI can reach a model running on your own hardware.

LobeChat is a polished, open-source chat UI you can run in the browser, as a desktop app, or self-hosted. It reaches OpenAI-compatible endpoints through its **OpenAI** provider — set the **API Proxy Address** to `https://api.tokios.com/v1` with your `sk-tok-…` key, and LobeChat chats with a model on your own hardware instead of the default hosted API.

## Prerequisites

> [card] [Connector paired](https://docs.tokios.com/setup/connector-install.md)
>
> Install and pair `tokios-connector` next to the model you want LobeChat to reach.

> [card] [Model registered](https://docs.tokios.com/setup/register-model.md)
>
> Register a deployment (public name) for that model.

> [card] [API key created](https://docs.tokios.com/setup/api-keys.md)
>
> Create an `sk-tok-…` key, optionally scoped to that deployment.

> [card] [Supported backends](https://docs.tokios.com/setup/supported-backends.md)
>
> Confirm your local backend (Ollama, llama.cpp, vLLM, LM Studio) is running.

## Option A — configure it in the app

**1. Open the OpenAI provider settings**

In LobeChat, go to **Settings → Language Model → OpenAI**. Enable the provider.

**2. Set the API key and proxy address**

Enter your key and point the proxy address at Tokios:

```text theme={"theme":{"light":"github-light","dark":"css-variables"}}
API Key: sk-tok-YOUR_KEY
API Proxy Address: https://api.tokios.com/v1
```

The **API Proxy Address** is LobeChat's base-URL override — include `/v1`.

**3. Add your deployment as a model**

Add a model using the **public deployment name** you registered in the [Models](https://tokios.com/console/models) tab — for example, `gemma-tunnel`. This is the value LobeChat sends in the `model` field, not your backend's local model id.

## Option B — configure it with environment variables

If you self-host LobeChat (for example with Docker), set these environment variables instead of using the in-app fields:

```text .env theme={"theme":{"light":"github-light","dark":"css-variables"}}
OPENAI_API_KEY=sk-tok-YOUR_KEY
OPENAI_PROXY_URL=https://api.tokios.com/v1
OPENAI_MODEL_LIST=+gemma-tunnel
```

`OPENAI_PROXY_URL` overrides the base URL (include `/v1`), and `OPENAI_MODEL_LIST=+gemma-tunnel` adds your deployment to the model picker. The exact variable names can shift between LobeChat releases — confirm them against the [self-hosting model-provider docs](https://lobehub.com/docs/self-hosting/environment-variables/model-provider) for your version.

> [!WARNING]
>
> Never commit a real `sk-tok-…` key into version control or a shared compose file. Provide it through the environment or the in-app field instead.

## Hosted UI, home model

Run LobeChat wherever it's convenient — a browser, a VPS, or a container — and it still reaches a model on your home machine. The connector next to that model dials outward to Tokios; LobeChat calls `https://api.tokios.com/v1` with your key. You don't bind your backend to `0.0.0.0`, open an inbound port, or set up a VPN.

## Troubleshooting

> [accordion] 401 error
>
> The API key LobeChat sent is missing, malformed, or has been revoked. Confirm the key (in-app or in `OPENAI_API_KEY`) is the full `sk-tok-…` value with no extra whitespace, and check its status on the [Keys](https://tokios.com/console/keys) tab.

> [accordion] 404 error
>
> The model value doesn't match a registered deployment, or the proxy address is missing `/v1`. Confirm the model name matches the public name on the [Models](https://tokios.com/console/models) tab, and that the address is `https://api.tokios.com/v1`.

> [accordion] 503 error
>
> The connector for that deployment is offline or at its concurrency cap. Check the [Connectors](https://tokios.com/console/connectors) tab — the connector needs to show as **Online**, and the machine running it needs to still be up and reachable.

## Next steps

> [card] [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md)
>
> See base URL and key setup for other OpenAI- and Anthropic-compatible clients.

> [card] [API keys](https://docs.tokios.com/setup/api-keys.md)
>
> Create separate scoped keys for teammates using the same LobeChat instance.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.