Self hosting Inferable
Self-hosting Inferable Open Source
Inferable is open source (MIT license) and can be self-hosted on your own infrastructure. This guide will walk you through setting up a self-hosted instance of Inferable using Docker Compose.
Requirements:
- Docker
- Docker Compose
Download Docker Compose definition
We provide a Docker Compose definition within the Inferable repository.
Use curl
to download the file:
Define environment variables
When running using docker-compose.yml
, most environment variables have defaults but the following need to be provided explicitly:
MANAGEMENT_API_SECRET
(This can be generated usingopenssl rand -hex 32
, take note of the value)ANTHROPIC_API_KEY
(With access toclaude-3-5-sonnet
/claude-3-haiku
- our default reasoning models)COHERE_API_KEY
(With access toembed-english-v3
- our default embedding model)
You can alternatively (or in addition) use AWS Bedrock as the model provider. This will require you to provide AWS credentials. Please see the configuration section.
Start Docker Compose
This will start The Inferable control plane at http://localhost:4000
and the following auxiliary resources:
- PostgreSQL database with pgvector
- Redis for caching
- ElasticMQ for a local SQS-compatible queue implementation
Manage via the CLI
The Inferable CLI can be used to manage your Inferable instance.
Export INFERABLE_API_ENDPOINT
to target your instance, rather than Inferable Cloud.
Register functions
Configuration
The Inferable control-plane accepts the following environment variables:
Variable | Description | Required |
---|---|---|
MANAGEMENT_API_SECRET | A deployment secret for the management API. | Yes (If running in headless mode) |
ANTHROPIC_API_KEY | API key for the Anthropic API. | Yes (If Bedrock is not available) |
COHERE_API_KEY | API key for the Cohere API. | Yes (If Bedrock is not available) |
BEDROCK_AVAILABLE | If set to true , Bedrock will be used as the model provider (You must also provide AWS credentials). | No |
DATABASE_URL | The connection string for the PostgreSQL database. | Yes |
DATABASE_SSL_DISABLED | If set to true , SSL will be disabled for the PostgreSQL database. | No |
REDIS_URL | The connection string for the Redis instance. | Yes |
SQS_RUN_PROCESS_QUEUE_URL | The connection string for the SQS queue. | Yes |
SQS_RUN_GENERATE_NAME_QUEUE_URL | The connection string for the SQS queue. | Yes |
SQS_CUSTOMER_TELEMETRY_QUEUE_URL | The connection string for the SQS queue. | Yes |
SQS_EXTERNAL_TOOL_CALL_QUEUE_URL | The connection string for the SQS queue. | Yes |
APP_ORIGIN | The origin of the Inferable Web UI for CORS. | No |
JWKS_URL | The URL of the Clerk JWKS url. | No |
Headless Mode
This self-hosting guide will produce a “headless” instance of Inferable, meaning the the control plane will be running but not the Web UI. Web UI is not essential to interacting with the control-plane.
The Web UI relies on Clerk for authentication with Cluster being associated with a Clerk Organization.
In headless mode, a MANAGEMENT_API_SECRET
is used instead.
The MANAGEMENT_API_SECRET
should only be used for managing clusters. You can use it to create API Keys which are used by the SDK to register functions.
The Web UI is also open source. We will be adding a guide for self-hosting the Web UI in the future.
Was this page helpful?