Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🌐 @free-ai-gateway/gateway

High-throughput Fastify HTTP AI Gateway proxy providing OpenAI-compatible endpoints with capability routing, auto-discovery, and automatic failover.

License: MIT Fastify Docker


📖 Overview

@free-ai-gateway/gateway is the production HTTP proxy application of Free-AI Gateway. Built on Fastify 5.x, it translates standard OpenAI API requests into capability queries, dispatches them through @free-ai-gateway/core, and returns compliant OpenAI responses to any SDK or frontend.


🚀 Running the Gateway

Development Mode

npm run dev

Production Mode

npm run build
npm start

Docker Container

docker-compose up -d

📡 API Endpoints

1. Chat Completions (POST /v1/chat/completions)

Standard OpenAI-compatible chat completion endpoint. Supports explicit model IDs or capability selectors (e.g. auto:reasoning, auto:tool_calling+structured_output).

curl http://localhost:3000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto:reasoning",
    "messages": [
      { "role": "user", "content": "How many r'\''s are in strawberry?" }
    ]
  }'

2. Embeddings (POST /v1/embeddings)

curl http://localhost:3000/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto:embedding",
    "input": "The quick brown fox jumps over the lazy dog"
  }'

3. Models List (GET /v1/models)

Returns an OpenAI-compliant list of all currently discovered provider models and capability routes.

4. Health & System Metrics (GET /health)

Returns gateway uptime, active providers, and circuit breaker health statuses.


📄 License

MIT © Md. Mahedi Zaman Zaber