Thor  by AIDotNet

Unified gateway for managing diverse AI models

Created 1 year ago
253 stars

Top 99.3% on SourcePulse

GitHubView on GitHub
Project Summary

Thor is an enterprise-grade AI model management gateway designed for unified API access and orchestration of multiple AI models. It targets users and organizations needing to consolidate management, billing, and access control for diverse AI services, offering a single point of integration compatible with the OpenAI format. The primary benefit is simplifying the complexity of interacting with numerous AI providers and models through a consistent interface.

How It Works

Thor acts as a central gateway, abstracting various AI service providers and open-source models behind a unified API. It employs a channel management system to configure and route requests to different AI backends, including OpenAI-compatible services, cloud AI platforms (AWS Bedrock, GCP Vertex AI), and local deployments (Ollama). The system incorporates user management for access control, a token-based billing system with cache optimization for cost management, and real-time monitoring for usage analytics. Its architecture supports load balancing and failover for high availability.

Quick Start & Requirements

  • Primary Install/Run: One-click Docker deployment using docker run -d --name thor -p 18080:8080 -v $(pwd)/data:/data -e TZ=Asia/Shanghai -e DBType=sqlite -e ConnectionStrings:DefaultConnection="data source=/data/token.db" -e ConnectionStrings:LoggerConnection="data source=/data/logger.db" -e RunMigrationsAtStartup=true aidotnet/thor:latest. Docker Compose configurations for SQLite and PostgreSQL are also provided.
  • Prerequisites: Docker 20.10+, at least 1GB available memory, 500MB disk space. For development: .NET 8.0 SDK, Node.js 18+, Git.
  • Access: System Admin Panel at http://localhost:18080 with default credentials admin/admin.
  • Links: Docker Hub: https://hub.docker.com/r/aidotnet/thor.

Highlighted Details

  • Supports over 20 AI models and providers, including OpenAI, Azure OpenAI, Kimi, Claude, Baidu Wenxin Yiyan, Alibaba Tongyi Qianwen, Ollama, AWS Bedrock, and Google Vertex AI.
  • Features a comprehensive user management system with API key generation, distribution, and permission control.
  • Includes smart billing with precise token-based calculations and cache optimization, alongside real-time monitoring and data visualization.
  • Offers flexible database support, including SQLite (default), PostgreSQL, SQL Server, MySQL, and Dameng Database.

Maintenance & Community

The project primarily relies on GitHub Issues and Pull Requests for contributions and support. No explicit community channels like Discord or Slack, nor a public roadmap, are detailed in the README.

Licensing & Compatibility

The project is licensed under the MIT License, which is permissive for commercial use and integration into closed-source applications.

Limitations & Caveats

Switching database types requires manual data backup and migration; data is not automatically migrated between different database systems. For HTTPS configuration, using a reverse proxy like Nginx is recommended, as Thor itself focuses on API gateway functionality. Resetting the admin password involves deleting user records from the database.

Health Check
Last Commit

2 weeks ago

Responsiveness

1 week

Pull Requests (30d)
1
Issues (30d)
0
Star History
5 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.