TrustGate
April 1, 2025 ยท View on GitHub
โจ Features
- ๐ High Performance: Built in Go for maximum efficiency and minimal latency
- ๐ Multi-Provider: Multiple LLM provider support
- ๐ค AI-Ready: Optimized for AI model providers (OpenAI, Anthropic, etc.)
- ๐ Fallback Ready: Built-in model fallback capabilities
- ๐ Load Balancing: Advanced algorithms including round-robin, weighted round-robin, and IP hash
- ๐ Security: Built-in authentication, rate limiting, and token management
- ๐ Plugin System: Extensible architecture for custom functionality
- โก Real-time Config: Dynamic configuration without restarts
- โ๏ธ Cloud Agnostic: Deploy anywhere with cloud-agnostic architecture
๐ Quick Start
Using Docker Compose
# Clone the repository
git clone https://github.com/NeuralTrust/TrustGate.git
cd TrustGate
# Clone env
cp .env.example .env
# Start the services
docker compose -f docker-compose.prod.yaml up -d
Using Kubernetes
Coming soon
Local Development
# Start dependencies
docker compose up -d redis postgres
# Run the servers
./scripts/run_local.sh
Run Unit Tests
make test
Run Functional Tests
make test-functional
๐๏ธ Architecture
TrustGate consists of two main components:
-
Admin API (Port 8080)
- Gateway management
- Configuration management
- API key management
- Plugin configuration
-
Proxy API (Port 8081)
- Request routing
- Load balancing
- Plugin execution
๐ Monitoring
TrustGate provides comprehensive monitoring through Prometheus metrics:
# config.yaml
metrics:
enabled: true # Enable metrics collection
enable_latency: true # Basic latency metrics
enable_upstream: true # Upstream latency tracking
enable_connections: true # Connection tracking
enable_per_route: true # Per-route metrics
Key Metrics
trustgate_requests_total- Request counts by gateway, method, and statustrustgate_latency_ms- Overall request processing timetrustgate_detailed_latency_ms- Granular latency by service/routetrustgate_upstream_latency_ms- Upstream service latencytrustgate_connections- Active connection tracking
Prometheus Configuration
scrape_configs:
- job_name: 'trustgate'
static_configs:
- targets: ['localhost:9090']
For detailed metrics documentation, dashboards, and advanced queries, see our Monitoring Guide.
๐ค Contributing
We love contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
๐ License
TrustGate is licensed under the Apache License 2.0 - see the LICENSE file for details.
๐ Star History
๐ซ Community & Support
Made with โค๏ธ by NeuralTrust