𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗲 𝗟𝗶𝗯𝗿𝗲𝗖𝗵𝗮𝘁 𝘄𝗶𝘁𝗵 𝗟𝘆𝗻𝗸𝗿 𝘃𝗶𝗮 𝗖𝘂𝘀𝘁𝗼𝗺 𝗘𝗻𝗱𝗽𝗼𝗶𝗻𝘁𝘀
Stop connecting providers directly to your chat app. Use a gateway instead.
If you run LibreChat, you can clean up your setup by putting a gateway between the app and your models. LibreChat supports OpenAI-compatible endpoints. You can point LibreChat to Lynkr and let Lynkr handle routing, caching, and provider switching.
This keeps your app stable.
The Architecture: • Browser connects to LibreChat. • LibreChat connects to Lynkr. • Lynkr connects to OpenAI, Anthropic, Ollama, or others.
LibreChat manages the UI, agents, and files. Lynkr manages routing, caching, and model control.
How to Set It Up:
Install Lynkr: npm install -g lynkr
Configure your .env file for Lynkr: MODEL_PROVIDER=ollama OLLAMA_ENDPOINT=http://localhost:11434 OLLAMA_MODEL=qwen2.5-coder:latest PORT=8081 PROMPT_CACHE_ENABLED=true SEMANTIC_CACHE_ENABLED=true
Start Lynkr: lynkr start
Verify the endpoint: curl http://localhost:8081/
Your base URL for LibreChat is: http://localhost:8081/v1
In LibreChat, add a custom OpenAI-compatible endpoint with these settings: • Base URL: http://localhost:8081/v1 • API Key: any value • Model: a name Lynkr recognizes (like gpt-4o-mini)
Note for Docker users: If LibreChat runs in Docker, use http://host.docker.internal:8081/v1 instead of localhost.
Why This Matters:
You gain provider portability. You can switch from OpenRouter to Bedrock without touching your LibreChat config.
You can use model aliases. Instead of choosing raw models, you can create stable names in Lynkr like:
- chat-fast (routes to a cheap model)
- chat-quality (routes to a strong model)
You get better reliability. You can set up a primary backend and a fallback backend. If one fails, Lynkr switches to the other automatically.
Keep your responsibilities separate. Let LibreChat handle the user experience and let Lynkr handle the infrastructure.
Optional learning community: https://t.me/GyaanSetuAi