> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/chat-interfaces/lobechat.md).

# LobeChat

[LobeChat](https://lobehub.com/) is an open-source, modern-design ChatGPT/LLM UI. Connect it to TensorX using the OpenAI-compatible configuration.

## Prerequisites

* LobeChat installed (self-hosted or local)
* TensorX API key from [app.tensorx.ai](https://app.tensorx.ai)

## Configuration Options

### Option 1: Environment Variables (Recommended for Self-Hosted)

Set these environment variables when deploying LobeChat:

```bash
# Required
OPENAI_API_KEY=your-tensorx-api-key
OPENAI_PROXY_URL=https://api.tensorx.ai/v1

# Optional: Customize available models
OPENAI_MODEL_LIST=-all,+claude-sonnet-4-20250514,+gpt-4o,+gpt-4o-mini
```

### Option 2: UI Configuration

1. Open LobeChat Settings (gear icon)
2. Navigate to **AI Service Provider** > **OpenAI**
3. Configure:
   * **API Key**: Your TensorX API key
   * **API Proxy URL**: `https://api.tensorx.ai/v1`
4. Save settings

## Docker Deployment

Deploy LobeChat with TensorX configuration:

```yaml
# docker-compose.yml
version: '3.8'
services:
  lobe-chat:
    image: lobehub/lobe-chat
    ports:
      - "3210:3210"
    environment:
      - OPENAI_API_KEY=your-tensorx-api-key
      - OPENAI_PROXY_URL=https://api.tensorx.ai/v1
      - OPENAI_MODEL_LIST=-all,+claude-sonnet-4-20250514,+claude-3-5-sonnet-20241022,+gpt-4o,+gpt-4o-mini
```

Run with:

```bash
docker-compose up -d
```

## Vercel Deployment

When deploying to Vercel, set these environment variables in your project settings:

| Variable            | Value                                                 |
| ------------------- | ----------------------------------------------------- |
| `OPENAI_API_KEY`    | Your TensorX API key                                  |
| `OPENAI_PROXY_URL`  | `https://api.tensorx.ai/v1`                           |
| `OPENAI_MODEL_LIST` | `-all,+claude-sonnet-4-20250514,+gpt-4o,+gpt-4o-mini` |

## Model List Configuration

The `OPENAI_MODEL_LIST` environment variable controls available models:

* Use `+model-name` to add a model
* Use `-model-name` to hide a model
* Use `-all` to disable all default models first
* Use `model_name=Display Name` to customize display names

Example configurations:

```bash
# Only TensorX models
OPENAI_MODEL_LIST=-all,+claude-sonnet-4-20250514,+claude-3-5-sonnet-20241022,+gpt-4o,+gpt-4o-mini

# With custom display names
OPENAI_MODEL_LIST=-all,+claude-sonnet-4-20250514=Claude Sonnet 4,+gpt-4o=GPT-4o
```

## Available Models

See [TensorX Models](/api-reference/models.md) for all available models.

Popular choices for LobeChat:

| Model                        | Best For                         |
| ---------------------------- | -------------------------------- |
| `claude-sonnet-4-20250514`   | Complex conversations, analysis  |
| `claude-3-5-sonnet-20241022` | General chat, coding assistance  |
| `gpt-4o`                     | Multi-modal, image understanding |
| `gpt-4o-mini`                | Fast responses, cost-effective   |

## Troubleshooting

### Empty responses

Check that `OPENAI_PROXY_URL` includes `/v1` at the end.

### Models not appearing

Verify `OPENAI_MODEL_LIST` syntax:

* Each model should be prefixed with `+`
* Use commas without spaces to separate models

### Authentication errors

Ensure your TensorX API key is valid and has available credits.

## Resources

* [LobeChat Documentation](https://lobehub.com/docs)
* [LobeChat GitHub](https://github.com/lobehub/lobe-chat)
* [TensorX API Reference](/api-reference/overview.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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tensorx.ai/chat-interfaces/lobechat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
