# LobeChat

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

## Prerequisites

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

## Configuration Options

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

Set these environment variables when deploying LobeChat:

```bash
# Required
OPENAI_API_KEY=your-tensorix-api-key
OPENAI_PROXY_URL=https://api.tensorix.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 Tensorix API key
   * **API Proxy URL**: `https://api.tensorix.ai/v1`
4. Save settings

## Docker Deployment

Deploy LobeChat with Tensorix configuration:

```yaml
# docker-compose.yml
version: '3.8'
services:
  lobe-chat:
    image: lobehub/lobe-chat
    ports:
      - "3210:3210"
    environment:
      - OPENAI_API_KEY=your-tensorix-api-key
      - OPENAI_PROXY_URL=https://api.tensorix.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 Tensorix API key                                 |
| `OPENAI_PROXY_URL`  | `https://api.tensorix.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 Tensorix 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 [Tensorix 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 Tensorix API key is valid and has available credits.

## Resources

* [LobeChat Documentation](https://lobehub.com/docs)
* [LobeChat GitHub](https://github.com/lobehub/lobe-chat)
* [Tensorix API Reference](/api-reference/overview.md)


---

# Agent Instructions: 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.tensorix.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.
