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
open-assistant-api logo

Self-host open-assistant-api

OpenAI-compatible self-hosted assistant API with RAG

AlphaOpen SourceMIT
Updatedlast year
LanguagePython
Setup difficultyModerate
Stars
369
Ports
8086 (API server), 80 (Playground UI)
Requires
MinIO (S3-compatible storage), MySQL, Redis
Docker
samepaage/open-assistant-api
Install with Docker Compose
Token management and user isolation UI

What is open-assistant-api?

Open Assistant API provides a drop-in replacement for the OpenAI Assistants API that you can run on your own infrastructure. It implements the OpenAI-compatible REST interface so existing code using the official OpenAI Python client works unchanged. The project adds retrieval-augmented generation through the R2R engine, optional web search via the Bing API, and an extensible tool system for custom functions. It supports multimodal inputs and streaming message output. Deployment is via Docker Compose, which spins up the API server, a Celery worker, a playground UI, MySQL, Redis, and MinIO (S3-compatible object storage). Authentication uses Bearer tokens with optional admin-token-protected token management for multi-tenant SaaS-style deployments. The codebase is MIT-licensed and written in Python 3.10 using FastAPI, Celery, SQLModel, and LangChain. There are no published releases yet; the main branch receives regular commits.

Should you self-host open-assistant-api?

open-assistant-api scores 44/100 on selfhost.directory (how scoring works) and ranks #71 of 120 in AI Assistant. It has 369 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 moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is OpenOpenAI (45/100, 549 stars). It scores higher overall, so compare the two before you pick. See open-assistant-api vs OpenOpenAI side by side.

Features

  • OpenAI Assistants API Compatibility

open-assistant-api README

How to install open-assistant-api

Install open-assistant-api with Docker Compose

Docker and Docker Compose

docker compose up -d

Requires Docker and Docker Compose installed. Configure .env or docker-compose.yml with API keys first.

How to configure open-assistant-api

  • APP_AES_ENCRYPTION_KEY7700b2f9c8dd982dfaddf8b47a92f1d900507ee8ac335f96a64e9ca0f018b195AES encryption key for secrets

    AES encryption key for secrets

  • APP_API_PREFIX/apiAPI URL prefix

    API URL prefix

  • APP_AUTH_ADMIN_TOKENadminAdmin token for token management APIs

    Admin token for token management APIs

  • APP_AUTH_ENABLEFalseEnable token-based authentication

    Enable token-based authentication

    values: True/False

  • APP_DEBUGTrueEnable debug mode

    Enable debug mode

    values: True/False

  • APP_ENVlocalEnvironment (local/prod)

    Environment (local/prod)

    values: local/prod

  • APP_NAMEopen-assistant-apiApplication name

    Application name

  • APP_SERVER_HOST0.0.0.0Server bind host

    Server bind host

  • APP_SERVER_PORT8086Server port

    Server port

  • APP_SERVER_WORKERS1Number of server workers

    Number of server workers

  • BING_SEARCH_URLhttps://api.bing.microsoft.com/v7.0/searchBing Search API endpoint

    Bing Search API endpoint

  • BING_SUBSCRIPTION_KEYxxxxBing Search API subscription key

    Bing Search API subscription key

  • CELERY_BROKER_URLredis://:123456@127.0.0.1:6379/1Celery broker URL (Redis)

    Celery broker URL (Redis)

  • DB_DATABASEopen_assistantDatabase name

    Database name

  • DB_HOST127.0.0.1Database host

    Database host

  • DB_PASSWORD123456Database password

    Database password

  • DB_POOL_SIZE1Database connection pool size

    Database connection pool size

  • DB_PORT3306Database port

    Database port

  • DB_USERrootDatabase user

    Database user

  • FILE_SERVICE_MODULEapp.services.file.impl.oss_file.OSSFileServiceFile service implementation (OSS or R2R)

    File service implementation (OSS or R2R)

    values: app.services.file.impl.oss_file.OSSFileService / app.services.file.impl.r2r_file.R2RFileService

  • LLM_MAX_STEP25Maximum LLM reasoning steps

    Maximum LLM reasoning steps

  • LOG_LEVELDEBUGLogging level

    Logging level

    values: DEBUG/INFO/WARNING/ERROR

  • OPENAI_API_BASEOpenAI-compatible API base URL (e.g., One API)

    OpenAI-compatible API base URL (e.g., One API)

  • OPENAI_API_KEYOpenAI/One API key

    OpenAI/One API key

  • R2R_BASE_URLhttp://127.0.0.1:8000R2R API base URL

    R2R API base URL

  • R2R_PASSWORDchange_me_immediatelyR2R password

    R2R password

  • R2R_SEARCH_LIMIT10R2R search result limit

    R2R search result limit

  • R2R_USERNAMEadmin@example.comR2R username

    R2R username

  • REDIS_DB0Redis database number

    Redis database number

  • REDIS_HOSTlocalhostRedis host

    Redis host

  • REDIS_PASSWORD123456Redis password

    Redis password

  • REDIS_PORT6379Redis port

    Redis port

  • S3_ACCESS_KEYminioadminS3 access key

    S3 access key

  • S3_BUCKET_NAMEoasS3 bucket name

    S3 bucket name

  • S3_ENDPOINThttp://minio:9000S3-compatible storage endpoint

    S3-compatible storage endpoint

  • S3_REGIONus-east-1S3 region

    S3 region

  • S3_SECRET_KEYminioadminS3 secret key

    S3 secret key

  • TOOL_WORKER_EXECUTION_TIMEOUT180Tool execution timeout in seconds

    Tool execution timeout in seconds

  • TOOL_WORKER_NUM10Number of tool workers

    Number of tool workers

  • WEB_SEARCH_NUM_RESULTS5Number of web search results

    Number of web search results

More in LLM Integration

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…