git404hub

what is chatapi fr?

zyf2007/chatapi — explained in plain English

Analysis updated 2026-05-18

40PythonAudience · developerComplexity · 3/5Setup · moderate

tl;dr

Self-hosted OpenAI-style chat API where a human operator types replies through a web console, useful for human-in-the-loop personas or mocking a real model during agent testing.

vibe map

mindmap
  root((ChatAPI))
    Inputs
      OpenAI requests
      Anthropic requests
      Operator typing
    Outputs
      Streamed replies
      Auto-replies
      ntfy notifications
    Use Cases
      Mock LLM for tests
      Human persona bot
      Roleplay backend
    Tech Stack
      Flask
      React
      Vite
      SQLite
      uv

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Stand in for a paid LLM during agent development by typing replies through the web console.

VIBE 2

Run a human-in-the-loop persona that answers chat traffic from OpenAI or Anthropic style clients.

VIBE 3

Configure scheduled streamed responses and pattern-based auto-replies for unattended sessions.

VIBE 4

Receive ntfy phone notifications when a new chat arrives so the operator can jump in.

what's the stack?

PythonFlaskReactViteAnt DesignSQLiteNginx

how it stacks up fr

zyf2007/chatapiasimons81/hermes-dreamingbaskduf/harness-starter-kit
Stars404040
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 1h+

Needs Python with uv, Node for the Vite build, a .env with admin creds, and optional Nginx plus TLS certs for production.

in plain english

This is a small Chinese-language self-hosted project that lets a real person sit on the other side of an OpenAI-style chat API. Other software thinks it is talking to an AI assistant, but the requests actually land in a web console where the operator types the replies by hand. The author also suggests using it as a mock language model for testing your own agent code without paying for a real model. The system has three parts: a Flask backend in Python, a React frontend built with Vite and Ant Design, and a SQLite file that stores users, sessions, and message history. Login uses a username and password set in a .env file, with optional TOTP for two-factor authentication. The same backend exposes three popular request shapes so most clients can connect without changes: /v1/chat/completions, /v1/responses, and Anthropic's /messages. Beyond manual replies, the web console can set automated behaviour. The operator can schedule streamed responses, send looping output, and configure conditional auto-replies that trigger on patterns in the incoming message. There is also optional ntfy push notification so the operator can hear about new chats on a phone. Deployment can go either through Nginx or be run directly from Flask. The frontend is built with npm install and npm run build, then served either by Nginx as static files or by Flask itself when the CHATAPI_WEB_DIST_DIR variable points at the dist folder. The backend is started with the uv tool: uv sync followed by uv run main.py. Common environment variables cover the listening host and port, the SQLite path, allowed CORS origins, optional TLS certificate files, and several optional email-sender configurations such as SMTP, Resend, Brevo, and Tencent Cloud SES. After login, the operator can manage the API key, the site title, the ntfy address, message rate limits, and TOTP inside a system-settings page rather than the .env file. The README shows a curl example that sends a streamed user message to /v1/responses against a model name written in Chinese, which is the project's character persona.

prompts (copy fr)

prompt 1
Set up ChatAPI on a VPS with uv sync, build the React frontend, and serve it through Nginx with TLS.
prompt 2
Point my OpenAI SDK client at ChatAPI's /v1/chat/completions and verify the streamed response shows up in the operator console.
prompt 3
Configure ntfy push and a TOTP second factor in the ChatAPI system-settings page without editing the .env file.
prompt 4
Write a pattern-based auto-reply rule in ChatAPI that fires on incoming messages containing a specific keyword.

Frequently asked questions

what is chatapi fr?

Self-hosted OpenAI-style chat API where a human operator types replies through a web console, useful for human-in-the-loop personas or mocking a real model during agent testing.

What language is chatapi written in?

Mainly Python. The stack also includes Python, Flask, React.

How hard is chatapi to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is chatapi for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.