Skip to main content

LibreChat

Configure LibreChat, the open-source ChatGPT alternative, to use Eden AI for access to 200+ AI models.

Overview

LibreChat is a free, open-source AI chat platform that supports multiple providers. By connecting it to Eden AI, you get:
  • 200+ models: Access OpenAI, Anthropic, Google, Cohere, and more through one interface
  • Self-hosted: Full control over your data and infrastructure
  • Cost savings: Leverage Eden AI’s competitive pricing
  • Unified experience: Single chat interface for all providers

Prerequisites

  • Docker and Docker Compose installed
  • Eden AI API key from https://app.edenai.run
  • Basic knowledge of environment variables

Installation

Clone LibreChat and set up with Docker:

Option 2: Manual Installation

Configuration

Step 1: Configure Environment Variables

Edit the .env file to add Eden AI configuration:

Step 2: Configure librechat.yaml

Create or edit librechat.yaml for advanced configuration:

Step 3: Start LibreChat

Access LibreChat at http://localhost:3080

Available Models

Configure which models appear in the LibreChat interface:

Features

Multi-Model Conversations

Switch between models mid-conversation:
  1. Start a conversation with Claude
  2. Click the model selector
  3. Switch to GPT-4 or Gemini
  4. Continue the conversation seamlessly

File Attachments

Upload files for vision-capable models:

Preset Prompts

Create custom prompts for common tasks:

Advanced Configuration

Custom Model Parameters

Configure temperature, max tokens, and other parameters:

User Authentication

Enable user registration and authentication:

Rate Limiting

Protect your API key with rate limiting:

Conversation History

Configure MongoDB for persistent conversations:

Docker Deployment

Production Docker Compose

Deploy to Production

Troubleshooting

Models Not Appearing

If models don’t show up in the interface:
  1. Check librechat.yaml syntax:
    # Validate YAML
    docker compose config
    
  2. Verify API key:
    # Test Eden AI endpoint
    curl -X POST https://api.edenai.run/v3/llm/chat/completions \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "anthropic/claude-3-5-sonnet-20241022",
        "messages": [{"role": "user", "content": "test"}],
        "stream": true
      }'
    
  3. Clear cache and restart:
    docker compose down
    docker compose up -d
    

Authentication Errors

If you see 401 errors:
  1. Check .env has correct API key
  2. Ensure no extra spaces in the key
  3. Verify OPENAI_REVERSE_PROXY URL is correct
  4. Restart services after changing .env

Slow Responses

If responses are slow:
  1. Use faster models for chat titles:
    titleModel: "openai/gpt-3.5-turbo"
    
  2. Disable unnecessary features:
    summarize: false
    
  3. Check your internet connection and Eden AI status

Connection Refused

If LibreChat can’t connect to MongoDB:
  1. Check MongoDB is running:
    docker compose ps mongodb
    
  2. Verify MONGO_URI in .env:
    MONGO_URI=mongodb://mongodb:27017/LibreChat
    
  3. Check network connectivity:
    docker compose logs mongodb
    

Security Best Practices

1. Secure API Keys

Never commit API keys to version control:

2. Use Environment-Specific Configs

3. Enable HTTPS

Use a reverse proxy like Nginx:

4. Implement Rate Limiting

Protect against abuse:

Cost Optimization

1. Use Appropriate Models

Configure cheaper models for simple tasks:

2. Monitor Usage

Track costs through Eden AI dashboard:

3. Limit Token Usage

Example Use Cases

1. Team Collaboration

Set up LibreChat for your team:
  • Enable user registration for team members
  • Configure multiple endpoints for different projects
  • Use presets for common workflows (code review, documentation, etc.)

2. Customer Support

Deploy as an internal support tool:
  • Create presets for support responses
  • Use conversation history to maintain context
  • Configure rate limits to prevent abuse

3. Development Assistant

Integrate with your development workflow:
  • Code assistance with Claude or GPT-4
  • Documentation generation with presets
  • Bug analysis with vision models (screenshots)

Next Steps