AIGate allows you to access the Generative AI providers through a proxy server which allows you to gather analytics, use uniform request and response formats, and use a single API key for all providers.
AIGate is still under heavy development and not ready for production use.
You can use binary releases or build from source. We use Deno to build and run the server.
You can download the latest binary release from the releases page. The binary is a single executable file that you can run from the command line.
You can build the server from source using the following command:
deno compile --allow-read --allow-env --allow-net --allow-sys --check main.ts
You can run the server using the following command:
./aigate start
The server will start on port 8080 by default. You can change the port using the
--port
flag.
./aigate start --port 8081
You can also use the --help
flag to see all available options.
./aigate --help
You can configure the server using the config.json
file. The file is
automatically created when you run the server for the first time. You can also
create the file manually using the following command:
./aigate init
AIGate supports the following providers:
AIGate supports various features that are not available in the original providers. Let's take a look at some of these features.
We support plugins that allow you to add new features to the server. You can find a list of available plugins in the plugins directory.
Custom plugins are not supported yet. We are working on a plugin system that will allow you to create your own plugins, similar to middleware approach in API frameworks.
You can track languages, sentiment, and other analytics for each request. You can also track the number of requests made to each provider. You can forward analytics to a database or a third-party service such as Datadog.
You can limit the number of overall requests to the server and the number of requests to each provider. You can also limit the number of requests per user.
This will allow you to control the costs and prevent abuse.
You can cache the responses to reduce the number of requests to the providers. It is possible to use different cache stores including in-memory cache and Redis.
Cache is based on the request parameters and the response and supported with completions, chat completions, and embeddings endpoints.
You can use the responses as-is from the Generative AI providers or you can use a unified response format. The unified response format is heavily inspired by the OpenAI API.
Enabling cost tracking will allow you to track the cost of each request. If you have custom pricing for each provider, you can configure the cost per token for each provider.
You deploy AIGate on your own server and you have full control over the data. You can also use the server behind a firewall or a VPN. You can put AIGate behind a reverse proxy such as Nginx or Caddy to add additional security features such as TLS.