Taiwan-built, self-hosted AI agent harness in a single Go binary — writes its own tools, sandbox-tests them, and shares them over MCP with Claude Code and Codex.
A standalone, bring-your-own-key AI chat workspace. No account, no server, no build step.
翻譯準備中
取自儲存庫 README
README
正在載入完整 README。 以下為已儲存的摘錄。
自托管多用户 AI 聊天服务与 API 网关。
A self-hosted multi-user AI chat service and API gateway.
Obsidian Arc 是一个自托管的多用户 AI 对话服务与 API 网关。系统采用单一 Go 二进制文件内嵌前端单页应用,使用 SQLite 或 PostgreSQL 存储数据,不依赖 Redis、消息队列或外部缓存。
邀请码:注册可设为开放、仅限邀请或关闭三档;管理员可批量生成邀请码,或生成一个绑定分组与随机试用天数的自定义合作方码(用于合作/赞助商链接,默认已注册账户也可直接领取,无需重新注册);账户也可开启个人邀请码,按「每邀请 N 人奖励 M 张重置卡」的节奏发放邀请奖励。
服务商聚合与模型路由:兼容 Anthropic Messages API 及兼容 OpenAI 协议的接口(OpenAI、DeepSeek、xAI、OpenRouter、Groq、Ollama、vLLM)。支持单个提供商挂载多款模型、模型映射路由(外部模型 ID 路由到底层实际模型 ID)与模型别名(api_name)。
OBSIDIAN_SECRET_KEY=$(openssl rand -hex 32) docker compose up -d
English
Obsidian Arc is a self-hosted multi-user AI chat service and API gateway. The entire application runs as a single Go binary with an embedded Vue 3 SPA frontend and uses SQLite or PostgreSQL for persistence, requiring no Redis, message queues, or external caches.
Accounts and Groups: Registration, authentication, and session management. User groups allow operators to assign model access lists and shared credit allowances.
Registration and Security: Email domain allowlists, optional email verification, and disposable-address detection. Turnstile and a self-developed, difficulty-tunable proof-of-work challenge are both available for signup, login, API key creation, and chat rate limiting. An optional model-based signup review can allow, restrict, or refuse a new account from its username and email, logged separately in the security audit trail.
Invite Codes: Registration can be open, invite-only, or closed. Administrators mint batches of codes, or one named partner code with a target group and a randomized trial length for sponsor and affiliate links — claimable by an existing account as well as a new signup by default. Accounts can also carry a personal invite code that pays out reset cards on a configurable "every N invites" cadence.
Provider Aggregation and Model Routing: Compatible with Anthropic Messages API and OpenAI-compatible endpoints (OpenAI, DeepSeek, xAI, OpenRouter, Groq, Ollama, vLLM). Supports mapping multiple models per provider, model routing (mapping exposed names to internal identifiers), and aliases (api_name).
Streaming and Reasoning Display: Server-Sent Events (SSE) streaming with live reasoning effort and thinking budget extraction. Client disconnection cancels outbound requests to stop provider billing. Supports switching models mid-conversation.
Projects & Multi-conversations: Standalone project contexts with system prompt inheritance for all member sessions; sidebar accordion supporting multiple conversations per project; full project lifecycle management (creation, rename, instructions update, and deletion without transcript loss).
Conversations & Archiving: Search, pin, rename, and delete conversation history; conversation archiving with global toggle (chat.allow_archive), 3-dots action menu, dedicated /archive panel for reviewing and unarchiving conversations; client-side image compression; code block actions.
Developer API Gateway (/v1): API Key authentication covering:
POST /v1/chat/completions (OpenAI format)
POST /v1/messages and POST /v1/messages/count_tokens (Anthropic Messages format, compatible with Claude Code)
POST /v1/responses (OpenAI Responses format, compatible with Codex)
Unified tool calling and function calling format conversion.
Admin Workbench & Terminal: Modular administration workbench with categorized navigation, responsive tabs, and automatic form draft recovery (settingsDraft). The Terminal in the account menu is a command line every account can open (a group can switch it off), and it runs only what that account could already do on its own screens: an ordinary account manages its own profile, keys, conversations, projects, credit, feedback and image history, and an administrator also gets the backoffice commands their grants cover (user, group, model, health, usage, …). It covers every administrative endpoint and every account-side setting that can be changed, with bilingual help, tab completion, and --json output. Setting OBSIDIAN_SSH_ADDR serves the same terminal over SSH (ssh user@host), scriptable one command at a time.
Uptime Monitoring and Circuit Breaking: Uptime tracking and health status checks; automated periodic probe checks for idle models; automatic circuit breaking on consecutive upstream failures and warning thresholds (health.warn_below); configurable public visibility with credential stripping for non-admin requests.
Image Lab: Standalone image generation interface with aspect-ratio selection, lightbox zoom, and download controls; capability flags distinguish drawing models from text models.
Usage Accounting and Rate Limits: Per-turn usage recorded into an append-only ledger; supports request count, token, and credit limits across 5-hour, weekly, and monthly windows; row-level database locks prevent concurrent overdrafts; administrators mint redemption codes or grant reset cards directly so accounts can restore their own allowance on a schedule.
Two-step verification (2FA): A guided setup under Settings → Security binds an authenticator app (TOTP — Google Authenticator, Microsoft Authenticator and the like) by QR code or typed key, with one-time recovery codes. Signing in — with a password, with GitHub or Google, or over the SSH terminal — then asks for a code as well. Operators choose who must have it (nobody, administrators before using the backoffice, all administrators, or everyone), the name apps show, and how long a browser may be remembered; they can see adoption and reset it for somebody who lost their phone.
Third-party Sign-in and OpenID Connect: The sign-in page can offer "Continue with GitHub / Google", matching existing accounts by the provider's verified email or its own stable user ID rather than a mutable address. The instance can also act as a standards-compliant OpenID Connect provider (/.well-known/openid-configuration, registered client apps, PKCE, token revocation) for other software to sign in against, and operators can require some or all accounts to link an identity before continuing.
Guest Landing and Trial: The signed-out landing page can be a login screen, a built-in marketing page, an operator-authored intro page, or an open guest chat; guest chat mode lets operators pick the trial model, a turn cap, and its own rate and concurrency limits so visitors can try the product without registering.
Leaderboard: An optional ranking of signed-in accounts by tokens or requests, shown by nickname, anonymously, or by a fixed handle at the operator's choice, with model-usage breakdown as a separate toggle.
Announcements and Site Notices: Markdown announcements with silent, once, or always reminder modes; a plain-text banner on the landing page that visitors can dismiss.
User Feedback: A feedback panel in the account menu lets anyone file a bug or an idea and keep following up in the same thread; administrators triage, reply, and resolve every submission from one backoffice page instead of a scattered inbox.
Instance Backups and Personal Export: Super administrators can schedule full-instance backups to an S3-compatible store (including Cloudflare R2) with a configurable retention window, and restore from an archive offline; any account can export or import its own conversations and preferences.
Security and Rendering: Frontend uses Vue template bindings with no innerHTML or v-html; upstream credentials stored encrypted; dark, light, and system theme options.
Plugins: Features only some instances want live under plugins/ and are compiled in by build tag; one left out carries no code, routes, tables or strings, and this repository ships none. A compiled-in plugin is installed, switched on and off, and uninstalled from the backoffice's Plugins screen, the way a browser's extensions page works (switching off and uninstalling need a two-step code, and an uninstall can take the plugin's data with it); a plugin can also bring backoffice pages of its own. See plugins.