forge  by TensorBlock

Unified API for AI models

Created 2 months ago
336 stars

Top 81.8% on SourcePulse

GitHubView on GitHub
Project Summary

<Forge addresses the challenge of managing multiple AI model providers by offering a unified API and simplified key management. It is designed for developers and organizations that utilize various AI models and seek a streamlined, secure, and scalable solution to integrate these models into their applications. Forge provides a single API endpoint and a unified key, abstracting away the complexities of individual provider APIs and key handling, thereby enhancing developer productivity and application flexibility.>

How It Works

Forge acts as a self-hosted middleware service. It securely stores API keys for various AI providers (e.g., OpenAI, Anthropic, Google Gemini) and exposes a single, unified API endpoint. This endpoint is compatible with the OpenAI API standard, allowing existing tools and frontends to integrate seamlessly. Forge employs a provider adapter pattern, enabling easy addition of new AI models and providers. API keys are encrypted at rest using Fernet symmetric encryption and are only decrypted temporarily in memory when processing requests, ensuring enhanced security and privacy.

Quick Start & Requirements

  • Installation: Can be installed via setup.sh (Linux/macOS) or setup.bat (Windows) after cloning the repository, or using Docker Compose. Manual setup involves creating a virtual environment with Python 3.12+, installing dependencies using uv, and running database migrations with Alembic.
  • Prerequisites: Python 3.12+, PostgreSQL instance (local Docker setup provided), uv package manager.
  • Setup: Requires configuring environment variables in a .env file, including DATABASE_URL, API_KEY_ENCRYPTION_KEY, and JWT_SECRET_KEY.
  • Documentation: API documentation is available at /docs when the server is running.

Highlighted Details

  • Supports a wide range of AI providers including OpenAI, Anthropic, Google Gemini, Cohere, Mistral, and many others through custom adapters and OpenAI-compatible interfaces.
  • Features OpenAI API compatibility for drop-in replacement and seamless integration with existing tools.
  • Implements robust security measures: API keys are encrypted using Fernet, stored securely, and never exposed in plaintext. JWT-based authentication is used for API interactions.
  • Offers a CLI for easy management of users, keys, and testing AI model interactions.

Maintenance & Community

The project is open-source and welcomes community contributions. Development guidelines and a CI pipeline using GitHub Actions for automated testing are in place. Specific details on maintainers, sponsorships, or community channels (like Discord/Slack) are not explicitly detailed in the README.

Licensing & Compatibility

The README mentions a "License" section but does not specify the license type or compatibility details for commercial use. Users should consult the LICENSE file in the repository for definitive information.

Limitations & Caveats

The README does not explicitly detail limitations, known bugs, or alpha/beta status. Users should be aware that self-hosting requires managing PostgreSQL and ensuring secure deployment practices, including setting up HTTPS and potentially IP restrictions. The security of the system relies heavily on correctly configuring and protecting the environment variables, especially the encryption and JWT secret keys.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
17
Issues (30d)
1
Star History
247 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.