# LibreChat

Connect LibreChat to Tensorix.ai and access leading open-source models like DeepSeek, Llama, Qwen, and GLM through a single self-hosted interface.

***

## What is LibreChat?

[LibreChat](https://www.librechat.ai/) is an open-source ChatGPT alternative that supports multiple AI providers through OpenAI-compatible APIs. With Tensorix, you get a privacy-focused, self-hosted chat interface with access to all our models.

{% hint style="success" %}
**Why LibreChat + Tensorix?**

* 🔒 **Self-hosted** - Your conversations stay on your infrastructure
* 🌍 **EU-hosted models** - Privacy-focused European hosting
* 🚀 **Multiple models** - DeepSeek, Llama, Qwen, GLM, and more
* 💰 **Simple pricing** - One API key, transparent costs
  {% endhint %}

***

## Prerequisites

* LibreChat installed and running (follow the [official LibreChat installation guide](https://www.librechat.ai/docs/configuration/docker_override))
* A Tensorix API key ([sign up here](https://app.tensorix.ai))

***

## Configuration

### Step 1: Add Your API Key

Add your Tensorix API key to LibreChat's `.env` file:

```bash
TENSORIX_API_KEY=your-tensorix-api-key-here
```

### Step 2: Configure the Tensorix Endpoint

Create or edit your `librechat.yaml` file:

```yaml
version: 1.1.7
cache: true

endpoints:
  custom:
    - name: "Tensorix AI"
      apiKey: "${TENSORIX_API_KEY}"
      baseURL: "https://api.tensorix.ai/v1"
      models:
        default:
          - "deepseek/deepseek-chat-v3.1"
          - "deepseek/deepseek-r1-0528"
          - "z-ai/glm-5.1"
          - "meta-llama/llama-3.3-70b-instruct"
          - "meta-llama/llama-4-maverick"
          - "qwen/qwen3-235b-a22b-2507"
          - "openai/gpt-oss-120b"
          - "minimax/minimax-m2.5"
        fetch: false
      titleConvo: true
      titleModel: "deepseek/deepseek-chat-v3.1"
      summarize: false
      summaryModel: "deepseek/deepseek-chat-v3.1"
      forcePrompt: false
      modelDisplayLabel: "Tensorix AI"
      dropParams: ["user"]
```

### Step 3: Mount the Configuration

Add this to your `docker-compose.override.yml`:

```yaml
services:
  api:
    volumes:
      - ./librechat.yaml:/app/librechat.yaml:ro
```

### Step 4: Restart LibreChat

```bash
docker compose restart api
```

***

## Using Tensorix in LibreChat

1. Open LibreChat in your browser
2. Start a new conversation
3. Click the model selector dropdown
4. Select **Tensorix AI** as the provider
5. Choose your preferred model

***

## Available Models

| Model                         | Features             | Best For                       |
| ----------------------------- | -------------------- | ------------------------------ |
| `z-ai/glm-5.1` ⭐              | Functions, Reasoning | Coding, reasoning, general use |
| `minimax/minimax-m2.5`        | Functions, Reasoning | Reasoning, general purpose     |
| `moonshotai/kimi-k2.5`        | Vision, Functions    | Vision, long context           |
| `deepseek/deepseek-chat-v3.1` | Functions, Reasoning | General chat, fast reasoning   |
| `deepseek/deepseek-r1-0528`   | Functions, Reasoning | Complex reasoning tasks        |
| `minimax/minimax-m2`          | Coding, Functions    | Coding, fast responses         |
| `meta-llama/llama-4-maverick` | Functions            | Long context, multimodal       |
| `openai/gpt-oss-120b`         | Functions, Reasoning | GPT-4 alternative              |

{% hint style="info" %}
**View full model list and pricing**: [tensorix.ai/models](https://tensorix.ai/models)
{% endhint %}

***

## Model Recommendations

| Task                  | Recommended Models                                                 |
| --------------------- | ------------------------------------------------------------------ |
| **General chat**      | `deepseek/deepseek-chat-v3.1`, `meta-llama/llama-3.3-70b-instruct` |
| **Complex reasoning** | `deepseek/deepseek-r1-0528`, `openai/gpt-oss-120b`                 |
| **Coding**            | `z-ai/glm-5.1`, `minimax/minimax-m2`                               |
| **Vision tasks**      | `moonshotai/kimi-k2.5`, `meta-llama/llama-4-maverick`              |
| **Multilingual**      | `z-ai/glm-5.1`                                                     |

***

## Advanced Configuration

### Auto-Fetch All Models

To automatically discover all available Tensorix models:

```yaml
models:
  fetch: true
  default:
    - "deepseek/deepseek-chat-v3.1"
```

### Custom Parameters

```yaml
endpoints:
  custom:
    - name: "Tensorix AI"
      apiKey: "${TENSORIX_API_KEY}"
      baseURL: "https://api.tensorix.ai/v1"
      models:
        default:
          - "deepseek/deepseek-chat-v3.1"
        fetch: false
      default: ["max_tokens", "temperature", "top_p"]
      additionalParameters:
        max_tokens: 4000
        temperature: 0.7
        top_p: 0.9
```

### Organize by Category

Create multiple endpoints for different model types:

```yaml
endpoints:
  custom:
    - name: "Tensorix - Reasoning"
      apiKey: "${TENSORIX_API_KEY}"
      baseURL: "https://api.tensorix.ai/v1"
      models:
        default:
          - "deepseek/deepseek-r1-0528"
          - "openai/gpt-oss-120b"
    
    - name: "Tensorix - General"
      apiKey: "${TENSORIX_API_KEY}"
      baseURL: "https://api.tensorix.ai/v1"
      models:
        default:
          - "meta-llama/llama-3.3-70b-instruct"
          - "z-ai/glm-5.1"
```

***

## Configuration Options

| Option           | Description                                          |
| ---------------- | ---------------------------------------------------- |
| `apiKey`         | Your Tensorix API key from environment variables     |
| `baseURL`        | Tensorix API endpoint (`https://api.tensorix.ai/v1`) |
| `models.default` | List of models shown in the dropdown                 |
| `fetch`          | Set `true` to auto-fetch available models            |
| `titleConvo`     | Auto-generate conversation titles                    |
| `titleModel`     | Model used for titles (use a fast model)             |
| `dropParams`     | Remove parameters that may cause issues              |

***

## Troubleshooting

### Models Not Appearing

1. Verify your API key is set in `.env`
2. Check that `librechat.yaml` is properly mounted
3. Restart the API container: `docker compose restart api`
4. Check logs: `docker compose logs api`

### Test Your API Key

```bash
curl https://api.tensorix.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "deepseek/deepseek-chat-v3.1",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### Configuration Not Loading

* Use proper YAML indentation (2 spaces)
* Verify quotes around strings
* Check version number matches your LibreChat version

***

## Best Practices

1. **Use fast models for titles** - Set `titleModel` to `deepseek/deepseek-chat-v3.1`
2. **Limit your model list** - Only include models you actually use
3. **Secure your API key** - Never commit `.env` files to version control
4. **Monitor usage** - Track API usage in your [Tensorix dashboard](https://app.tensorix.ai/dashboard)

***

## Resources

* [LibreChat Documentation](https://www.librechat.ai/docs)
* [LibreChat Custom Endpoints Guide](https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints/custom)
* [Tensorix Models & Pricing](https://tensorix.ai/models)
* [Tensorix API Examples](https://github.com/Tensorix-ai/tensorix-docs/blob/main/api-examples/README.md)

***

## Need Help?

* 📧 **Email**: <support@tensorix.ai>
* 💬 **Contact Support**: [Contact page](https://github.com/Tensorix-ai/tensorix-docs/blob/main/support/support/README.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/librechat.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.
