OpenOpenAI  by transitive-bullshit

Self-hosted API for OpenAI's stateful Assistants API

created 1 year ago
547 stars

Top 59.2% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a self-hosted, OpenAI Assistants API-compatible backend, enabling users to run custom models, implement custom RAG, or deploy Assistants on-premise. It targets developers and researchers seeking greater control and flexibility over their AI assistant deployments, offering full compatibility with OpenAI's SDKs.

How It Works

The backend leverages OpenAI's official OpenAPI specification to auto-generate API route definitions and types. This ensures wire-level compatibility with OpenAI's SDKs, allowing seamless switching between the official API and the self-hosted version by simply changing the baseURL. It utilizes Postgres for data storage via Prisma, Redis for task queuing with BullMQ, S3-compatible storage for files, and Hono for serving the REST API.

Quick Start & Requirements

  • Install dependencies: pnpm install
  • Generate Prisma types: pnpm generate
  • Set environment variables (Postgres, OpenAI API Key, Redis, S3).
  • Run services: npx tsx src/server (API) and npx tsx src/runner (task queue).
  • Prerequisites: Node.js >= 18, pnpm >= 8, Postgres, Redis, S3-compatible storage.
  • Docs: OpenAI Assistants Guide

Highlighted Details

  • 100% auto-generated API definitions from OpenAPI spec for compatibility.
  • Supports Assistants, AssistantFiles, Files, Messages, MessageFiles, Threads, Runs, and RunSteps.
  • Integrations planned for LangChain and LlamaIndex for RAG.
  • Can be used with custom code interpreters like open-interpreter.

Maintenance & Community

  • Developed by Travis Fischer.
  • Sponsorship and Twitter links provided for community engagement.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial use and closed-source linking due to permissive MIT license.

Limitations & Caveats

Support for the built-in code_interpreter tool and non-text files with the retrieval tool are currently missing. The retrieval implementation is basic and returns full file contents rather than relevant chunks. Resource IDs do not use OpenAI's prefix format.

Health Check
Last commit

4 months ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
0
Star History
11 stars in the last 90 days

Explore Similar Projects

Starred by Peter Norvig Peter Norvig(Author of Artificial Intelligence: A Modern Approach; Research Director at Google).

python-openai-demos by pamelafox

0%
374
Python scripts for OpenAI API demos
created 1 year ago
updated 1 week ago
Feedback? Help us improve.