clovapi is a shared model API network. Consumers use one platform API key to discover and call models supplied by online contribution nodes and platform capacity. Consumers do not need to install the CLI or contribute a resource first.
The open-source CLI is the contribution-node runtime. It keeps upstream provider profiles and credentials on the node, advertises available model IDs, executes relayed requests, and transcodes API formats. Its standalone local proxy is an advanced capability, not the product's primary identity.
This repository does not own local tool configuration management. That surface lives outside clovapi.
| Directory | Role |
|---|---|
core/ |
Go CLI, contribution-node runtime, protocol bridge, and relay core |
npm/ |
npm launcher package (@clovapi/cli) that installs/calls the core binary |
web/ |
Browser management UI (React + Vite), embedded and served by Go |
landing/ |
Static-exported Next.js documentation, console, and marketing site |
platform/ |
Cloudflare Worker platform API, D1 control plane, and Durable Object relay |
- CLI / contribution node / relay: Go 1.22+ (
core/) - Browser UI: React, Vite (
web/); Go management server (core/internal/webadmin/) - Website: Next.js static export on Workers Static Assets (
landing/) - Platform API: TypeScript, Cloudflare Workers, D1, and Durable Objects (
platform/)
consumer -> Platform Worker /v1 -> Relay Object -> contribution node -> upstream provider
-> platform supply
Web App Worker -> Platform Worker /api
advanced local client -> local proxy -> protocol bridge -> configured upstream
- Profiles:
~/.config/clovapi/profiles.jsonor%APPDATA%\clovapi\profiles.jsonon Windows - Consumer/control plane:
platform/ - Persistent node transport:
platform/andcore/internal/sharing/ - Protocol bridge:
core/internal/protocol/ - Proxy resolve:
core/internal/proxyresolve/
devis the integration branch;mainis the only production deployment branch.- Cloudflare Workers Builds deploys
platform/andlanding/on pushes tomain. Non-production branch builds and preview deployments are disabled. - Do not run the production Wrangler deploy commands from
dev: both configs bind production domains and the production D1 database. - Keep Cloudflare build credentials in Cloudflare, not GitHub Actions or repository files.
Core code uses standard encoding/json. There is no shared common/json.go wrapper in this repo.
web/andlanding/: follow each package README.- Build distributables with
npm run buildfrom the repository root (Vite assets before Go embedding). core/: usego buildandgo test ./...fromcore/.
- Marketing pages do not use eyebrow text, overlines, or decorative section numbers above headings. Lead with the heading itself.
- Use a black, white, and gray palette for marketing pages and their illustrations. Do not introduce chromatic accent colors as decoration.
- Give Chinese and English copy comfortable letter spacing and line height, especially in the hero and section introductions.
The core dev build version lives in core/internal/buildinfo/buildinfo.go as a devX.Y.Z string. Whenever local development changes modify code or behavior, increment this dev core version in the same change.