Documentation
Complete guide to setting up and using LLM Link with 10 major LLM providers. Universal proxy service with hot-reload configuration and multiple API format support.
Installation
Option 1: Install from crates.io (Recommended)
cargo install llm-linkInstalls the latest stable version from Rust package registry
Option 2: Build from source
git clone https://github.com/lipish/llm-link.git
cd llm-link
cargo build --releaseGet the latest features from the main branch
Quick Start
Start with Application Presets
Optimized configurations for popular AI coding tools:
# For Codex CLI (GitHub Copilot CLI)
llm-link --app codex-cli
# For Zed editor
llm-link --app zed
# For Claude Code
llm-link --app claude-code
# For Continue.dev
llm-link --app continueStart with Specific Protocols
Choose which API protocols to enable:
# Enable specific protocols
llm-link --protocols openai,anthropic,ollama
# Enable all protocols
llm-link --protocols all
# Start on custom port
llm-link --port 8088 --protocols openai,anthropicOptional API Key Startup
New in v0.3.3: LLM Link can now start without API keys!
Service starts normally and displays warnings for missing keys. Configure API keys later using hot-reload API.
Provider Configuration
Environment Variables
Set API keys as environment variables. For Ollama, no API key is required.
OpenAI
OPENAI_API_KEYLeading AI models including GPT-4, GPT-3.5, and more
Anthropic
ANTHROPIC_API_KEYAdvanced Claude models with strong reasoning capabilities
Zhipu AI
ZHIPU_API_KEYChinese AI models with multilingual support
Aliyun
ALIYUN_API_KEYAlibaba Cloud's powerful Qwen models
Volcengine
VOLCENGINE_API_KEYByteDance's advanced Doubao models
Tencent
TENCENT_API_KEYTencent's Hunyuan models for various applications
Longcat
LONGCAT_API_KEYHigh-performance models for general dialogue
Moonshot
MOONSHOT_API_KEYKimi models with large context windows
Minimax
MINIMAX_API_KEYPowerful AI models with OpenAI-compatible API
Ollama
None RequiredLocal and open-source models
Configuration File (Optional)
Create a keys.yaml file in the project directory:
providers:
openai:
api_key: "your_openai_key"
anthropic:
api_key: "your_anthropic_key"
zhipu:
api_key: "your_zhipu_key"
# ... other providersHot Reload Configuration
Dynamic Configuration Update
Update provider configurations without restarting the service using the REST API:
curl -X POST http://localhost:8088/api/config/update \
-H "Content-Type: application/json" \
-d '{"provider": "openai", "api_key": "new_key"}'Available API Endpoints
Update Configuration
POST /api/config/update Update provider API keys and settings
List Models
GET /api/models Get available models for all providers
Provider Status
GET /api/providers Check status of all configured providers
Health Check
GET /api/health Service health and version information
API Protocols
OpenAI API
Compatible with OpenAI's API format
Endpoint: /v1Supports chat completions, streaming, function calling
Anthropic API
Native Anthropic Claude API
Endpoint: /v1/messagesSupports messages API, streaming, long context
Ollama API
Compatible with Ollama's API format
Endpoint: /api/generateSupports local models, custom models, streaming
As a Rust Library
Add to Cargo.toml
[dependencies]
llm-link = "0.3.5"Usage Examples
List All Providers
use llm_link::provider::ProviderRegistry;
// List all available providers
let providers = ProviderRegistry::list_providers();
println!("Available providers: {:?}", providers)Get Models for Provider
use llm_link::models::ModelsConfig;
// Load models configuration
let models = ModelsConfig::load_with_fallback()
.get_models_for_provider("openai");
for model in models {
println!("Model: {}", model.name);
}Create LLM Client
use llm_link::provider::{Provider, ProviderConfig};
use llm_link::provider::openai::OpenAIProvider;
let config = ProviderConfig {
api_key: "your_key".to_string(),
base_url: None,
};
let client = OpenAIProvider::create_client(&config)?;
// Use client for chat completionsTroubleshooting
Service fails to start
Check if required ports are available. Use --port to specify a different port.
API key not working
Verify API key format and permissions. Use hot-reload API to update keys without restart.
Ollama connection failed
Ensure Ollama is running on localhost:11434. Use ollama pull to download models.