This example demonstrates how to set up the Inference Gateway with Docker Compose for a simple configuration with a single cloud-based model provider.
The Basic example sets up:
- Inference Gateway service
- Single cloud provider configuration
- Docker
- Docker Compose
- Create a
.envfile based on the provided example:
cp .env.example .env- Edit the
.envfile to configure your model provider:
OPENAI_API_KEY=your_api_key_here
Or any other provider you want to use.
- Start the Inference Gateway:
docker compose up -d- Verify the gateway is running:
docker compose psYou can test the gateway using curl commands:
curl -X GET http://localhost:8080/v1/modelscurl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "Hello, how are you today?"
}
]
}'You can configure additional options in the .env file:
SERVER_PORT- The port the gateway listens onLOG_LEVEL- Logging level (debug, info, warn, error)ENABLE_TELEMETRY- Enable/disable telemetry (true/false)ENABLE_AUTH- Enable/disable authentication (true/false)*_API_URL- Custom API URL for the provider (if needed)*_API_KEY- API key for the provider
- Main Documentation
- Hybrid Example - For using both local and cloud providers
- Configuration Guide