|
|
4 месяцев назад | |
|---|---|---|
| .github | 4 месяцев назад | |
| core | 4 месяцев назад | |
| docs | 6 месяцев назад | |
| mcp-servers | 4 месяцев назад | |
| openapi-mcp | 4 месяцев назад | |
| scripts | 4 месяцев назад | |
| web | 4 месяцев назад | |
| .gitignore | 6 месяцев назад | |
| Dockerfile | 4 месяцев назад | |
| LICENSE | 9 месяцев назад | |
| README.md | 6 месяцев назад | |
| README.zh.md | 6 месяцев назад | |
| docker-compose.yaml | 4 месяцев назад | |
| go.work | 4 месяцев назад | |
| go.work.sum | 4 месяцев назад |
Next-generation AI gateway with OpenAI-compatible protocol
[](https://github.com/labring/aiproxy/releases) [](https://github.com/labring/aiproxy/blob/main/LICENSE) [](https://github.com/labring/aiproxy/blob/main/core/go.mod) [](https://github.com/labring/aiproxy/actions) [English](./README.md) | [简体中文](./README.zh.md)AI Proxy is a powerful, production-ready AI gateway that provides intelligent request routing, comprehensive monitoring, and seamless multi-tenant management. Built with OpenAI-compatible protocols, it serves as the perfect middleware for AI applications requiring reliability, scalability, and advanced features.
<think> tagsAI Proxy provides a management panel for managing AI Proxy's configuration and monitoring.
graph TB
Client[Client Applications] --> Gateway[AI Proxy Gateway]
Gateway --> Auth[Authentication & Authorization]
Gateway --> Router[Intelligent Router]
Gateway --> Monitor[Monitoring & Analytics]
Gateway --> Plugins[Plugin System]
Plugins --> CachePlugin[Cache Plugin]
Plugins --> SearchPlugin[Web Search Plugin]
Plugins --> ThinkSplitPlugin[Think Split Plugin]
Plugins --> StreamFakePlugin[Stream Fake Plugin]
Router --> Provider1[OpenAI]
Router --> Provider2[Anthropic]
Router --> Provider3[Azure OpenAI]
Router --> ProviderN[Other Providers]
Gateway --> MCP[MCP Servers]
MCP --> PublicMCP[Public MCP]
MCP --> GroupMCP[Organization MCP]
MCP --> EmbedMCP[Embedded MCP]
Monitor --> Alerts[Alert System]
Monitor --> Analytics[Analytics Dashboard]
Monitor --> Logs[Audit Logs]
# Quick start with default configuration
docker run -d \
--name aiproxy \
-p 3000:3000 \
-v $(pwd)/aiproxy:/aiproxy \
-e ADMIN_KEY=your-admin-key \
ghcr.io/labring/aiproxy:latest
# Nightly build
docker run -d \
--name aiproxy \
-p 3000:3000 \
-v $(pwd)/aiproxy:/aiproxy \
-e ADMIN_KEY=your-admin-key \
ghcr.io/labring/aiproxy:main
# Download docker-compose.yaml
curl -O https://raw.githubusercontent.com/labring/aiproxy/main/docker-compose.yaml
# Start services
docker-compose up -d
LISTEN=:3000 # Server listen address
ADMIN_KEY=your-admin-key # Admin API key
SQL_DSN=postgres://user:pass@host:5432/db # Primary database
LOG_SQL_DSN=postgres://user:pass@host:5432/log_db # Log database (optional)
REDIS=redis://localhost:6379 # Redis for caching
BILLING_ENABLED=true # Enable billing features
SAVE_ALL_LOG_DETAIL=true # Log all request details
AI Proxy supports a plugin system that extends its functionality. Currently available plugins:
The Cache Plugin provides high-performance caching for AI API requests:
View Cache Plugin Documentation
The Web Search Plugin adds real-time web search capabilities:
View Web Search Plugin Documentation
The Think Split Plugin supports content splitting for reasoning models:
<think>...</think> tags in responsesreasoning_content fieldView Think Split Plugin Documentation
The Stream Fake Plugin solves timeout issues with non-streaming requests:
View Stream Fake Plugin Documentation
Visit http://localhost:3000/swagger/index.html for the complete API documentation with interactive examples.
curl -H "Authorization: Bearer your-token" \
http://localhost:3000/v1/models
curl -X POST http://localhost:3000/v1/chat/completions \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Deploy instantly on Sealos with built-in model capabilities: Deploy to Sealos
Seamlessly integrate with FastGPT for enhanced AI workflows: FastGPT Documentation
AI Proxy provides comprehensive MCP support for extending AI capabilities:
# Clone repository
git clone https://github.com/labring/aiproxy.git
cd aiproxy
# Build frontend (optional)
cd web && npm install -g pnpm && pnpm install && pnpm run build && cp -r dist ../core/public/dist/ && cd ..
# Build backend
cd core && go build -o aiproxy .
# Run
./aiproxy
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.