catalog-model-convert
v0.1.0
Published
Convert AI model IDs between catalog vendors (OpenRouter, OfoxAI, APIMart, Haimaker, AI/ML API, AWS, Azure, Cloudflare).
Maintainers
Readme
catalog-model-convert
Convert AI model IDs between catalog vendors in this monorepo:
- Gateways:
openrouter,ofoxai,apimart,haimaker,aimlapi - Cloud:
aws,azure,cloudflare - Direct:
direct(provider:modelId)
Uses a canonical pivot (providerId/modelSlug), then:
- Identity — same gateway id space (OpenRouter-style)
- Alias table — editable
data/aliases.json - Rules — format heuristics per vendor
Install
npm install catalog-model-convertUsage
import { convertModel, normalizeModel } from "catalog-model-convert";
const toAzure = convertModel({
modelId: "openai/gpt-4o",
from: "openrouter",
to: "azure",
});
// { ok: true, modelId: "gpt-4o", match: "alias", canonical: { key: "openai/gpt-4o", ... } }
const fromAws = convertModel({
modelId: "anthropic.claude-sonnet-5",
from: "aws",
to: "ofoxai",
});
// { ok: true, modelId: "anthropic/claude-sonnet-5", ... }CLI
npx catalog-model-convert convert --from openrouter --to azure openai/gpt-4o
npx catalog-model-convert convert --from aws --to openrouter anthropic.claude-sonnet-5
npx catalog-model-convert normalize --from cloudflare @cf/meta/llama-3.3-70b-instruct-fp8-fast
npx catalog-model-convert aliasesUpdating aliases
Edit data/aliases.json (canonical key → per-vendor native id, or null if unavailable), then rebuild/publish.
License
MIT
