PublicProviderConf is a TypeScript CLI and library that aggregates the canonical models.dev catalog together with several custom provider integrations (PPInfra, TokenFlux, Groq, Qiniu-hosted snapshots, and others). The tool normalizes capabilities, fills in missing metadata, and emits standardized JSON payloads that downstream apps can consume without bespoke adapters.
- Unified JSON schema for every provider with consistent capability flags
- Concurrent fetcher pipeline that merges live APIs with maintained templates
- Configurable CLI built with Commander + Vite for both dev (ts-node) and production builds
- Automated GitHub Actions workflow that can publish fresh
dist/
artifacts and sync them to CDN storage
The aggregated dataset starts with the upstream https://models.dev/api.json
. During each run we overlay:
- Provider overrides from
manual-templates/
- Live fetchers for operators that are not (yet) covered by models.dev, such as
ppinfra
,tokenflux
, andgroq
- Lightweight snapshots for ecosystems like
ollama
andsiliconflow
After post-processing, the CLI writes the final catalog to dist/
. Key outputs include:
dist/all.json
– aggregated providers, model counts, and capability rollupsdist/{provider}.json
– normalized payload for each individual provider
Consumers can point CDN tooling at the dist/
directory (see GitHub Actions workflow) to publish the latest data for public access.
- Node.js 18+
- pnpm 8+
git clone https://github.com/ThinkInAIXYZ/PublicProviderConf.git
cd PublicProviderConf
pnpm install
pnpm build
pnpm build
runs both Vite targets: the library bundle under build/
and the bundled CLI at build/cli.js
.
pnpm run dev # ts-node, defaults to fetch-all
ts-node src/cli.ts fetch-all # explicit command
ts-node src/cli.ts fetch-providers -p ppinfra,tokenflux
pnpm build
pnpm start # equivalent to node build/cli.js fetch-all
node build/cli.js fetch-providers -p ppinfra,tokenflux -o ./dist
pnpm install -g .
public-provider-conf fetch-all
public-provider-conf fetch-providers -p ppinfra,tokenflux
public-provider-conf fetch-all [options]
public-provider-conf fetch-providers -p <providers> [options]
Options:
-p, --providers <providers> Comma-separated provider IDs
-o, --output <dir> Output directory (default: dist)
-h, --help Show command help
- models.dev catalog (OpenAI, Anthropic, OpenRouter, Google Gemini, Vercel, GitHub Models, DeepSeek, etc.)
- PPInfra (live API)
- TokenFlux (marketplace API)
- Groq (requires
GROQ_API_KEY
) - Ollama (snapshot templates)
- SiliconFlow (snapshot templates)
Adding a new provider usually involves implementing Provider
under src/providers/
, adding configuration to src/config/app-config.ts
, and optionally contributing templates to manual-templates/
.
src/
├─ cli.ts # CLI entry point (Commander)
├─ commands/ # fetch-all, fetch-providers commands
├─ config/ # default configuration and loaders
├─ fetcher/ # HTTP + file-based fetch orchestrators
├─ models/ # Type definitions and helpers
├─ output/ # Writers, validators, distribution helpers
└─ providers/ # Individual provider integrations
- Default endpoints and flags live in
src/config/app-config.ts
- Override the models.dev endpoint with
MODELS_DEV_API_URL
- Provide an offline fallback snapshot via
MODELS_DEV_SNAPSHOT_PATH
- Set API secrets (e.g.
GROQ_API_KEY
) in your environment or CI secrets
pnpm install # install deps
pnpm run dev # ts-node dev loop
pnpm build # Vite builds (library + CLI)
pnpm start # run bundled CLI
Use DEBUG=true
when you need verbose fetcher logs.
The .github/workflows/fetch-models.yml
workflow builds the project, runs the fetch pipeline, validates JSON output, and can sync the dist/
directory to a Qiniu CDN bucket for distribution. Ensure the Qiniu credentials are available as repository secrets when enabling the CDN path.
- Fork the repository
- Create a feature branch
- Run
pnpm build
before raising a PR - Submit your PR with relevant test notes and updated templates if applicable
Issues and ideas are always welcome.
MIT © ThinkInAIXYZ