selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
OpenOpenAI logo

Self-host OpenOpenAI

Self-hosted OpenAI Assistants API compatible server

BetaOpen SourceMIT
Updatedlast year
LanguageTypescript
Setup difficultyAdvanced
Stars
549
Port
3000 (REST API server)
Requires
PostgreSQL, Redis, S3 compatible storage
Install with Node.js

What is OpenOpenAI?

OpenOpenAI implements the stateful portions of OpenAI's Assistants API — Assistants, Threads, Runs, Messages, Files, and the retrieval tool — with 100% auto-generated API routes and types from OpenAI's OpenAPI spec. This means you can point the official OpenAI Node.js or Python SDK at your own server by only changing the baseURL. The project consists of a REST API server (Hono) and an async task runner (BullMQ) that process thread runs. It requires Postgres as the primary datastore via Prisma, Redis for the task queue, and S3-compatible storage (like Cloudflare R2, MinIO, or LocalStack) for file uploads. An OpenAI API key is currently required for the underlying chat completion calls, though support for local models is planned. The server listens on port 3000 by default. The project is MIT licensed and actively developed.

Should you self-host OpenOpenAI?

OpenOpenAI scores 45/100 on selfhost.directory (how scoring works) and ranks #66 of 120 in AI Assistant. It has 549 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is advanced: plan for several services and some ongoing maintenance. It is MIT-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is open-assistant-api (44/100, 369 stars). OpenOpenAI scores higher overall. See OpenOpenAI vs open-assistant-api side by side.

Features

  • Assistants management
  • Built-in retrieval toolOnly supports text files; returns full file contents rather than semantically relevant chunks
  • Custom Functions
  • File uploads and management
  • Horizontal Scaling
  • OpenAI Assistants API Compatibility
  • OpenAPI Specification
  • Threads and Runs

OpenOpenAI README

How to install OpenOpenAI

Install OpenOpenAI with Node.js

Environment variables
OPENAI_API_KEY, DATABASE_URL, REDIS_HOST, REDIS_PORT, REDIS_USERNAME, REDIS_PASSWORD, S3_BUCKET, S3_REGION, S3_ENDPOINT, ACCESS_KEY_ID, SECRET_ACCESS_KEY

pnpm install pnpm generate cp .env.example .env

Configure .env with required values

npx prisma db push

Development

npx tsx src/server npx tsx src/runner

Production

pnpm build npx tsx dist/server npx tsx dist/runner

Requires Node.js >= 18 and pnpm >= 8

How to configure OpenOpenAI

  • ACCESS_KEY_IDS3 access key ID (required)

    S3 access key ID (required)

  • DATABASE_URLPostgres connection string

    Postgres connection string

  • OPENAI_API_KEYOpenAI API key for handling the underlying model calls

    OpenAI API key for handling the underlying model calls

  • REDIS_HOSTlocalhostRedis host (optional, defaults to localhost)

    Redis host (optional, defaults to localhost)

  • REDIS_PASSWORDRedis password (optional)

    Redis password (optional)

  • REDIS_PORT6379Redis port (optional, defaults to 6379)

    Redis port (optional, defaults to 6379)

  • REDIS_USERNAMEdefaultRedis username (optional, defaults to default)

    Redis username (optional, defaults to default)

  • S3_BUCKETS3 bucket name (required for file attachments)

    S3 bucket name (required for file attachments)

  • S3_ENDPOINTS3 endpoint URL (required, e.g. https://<id>.r2.cloudflarestorage.com)

    S3 endpoint URL (required, e.g. https://<id>.r2.cloudflarestorage.com)

  • S3_REGIONautoS3 region (optional, defaults to auto)

    S3 region (optional, defaults to auto)

  • SECRET_ACCESS_KEYS3 secret access key (required)

    S3 secret access key (required)

More in API

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…