Key: huggingfaceAPI: https://router.huggingface.co/v1Env: HF_TOKENNPM: @ai-sdk/openai-compatible
Tool-capable models (16):- moonshotai/Kimi-K2-Instruct- moonshotai/Kimi-K2.5 (reasoning)- deepseek-ai/DeepSeek-R1-0528- deepseek-ai/DeepSeek-V3.2- Qwen/Qwen3-235B-A22B-Thinking-2507 (reasoning)- Qwen/Qwen3-Coder-480B-A35B-Instruct- MiniMaxAI/MiniMax-M2.1- zai-org/GLM-4.7- ... and moreexport type KnownProvider = | "amazon-bedrock" | "anthropic" // ... existing providers ... | "huggingface" // ← Add here (alphabetically with others) | "opencode";const envMap: Record<string, string> = { // ... existing mappings ... huggingface: "HF_TOKEN",};// Process Hugging Face modelsif (data.huggingface?.models) { for (const [modelId, model] of Object.entries(data.huggingface.models)) { const m = model as ModelsDevModel; if (m.tool_call !== true) continue;
models.push({ id: modelId, name: m.name || modelId, api: "openai-completions", provider: "huggingface", baseUrl: "https://router.huggingface.co/v1", reasoning: m.reasoning === true, input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"], cost: { input: m.cost?.input || 0, output: m.cost?.output || 0, cacheRead: m.cost?.cache_read || 0, cacheWrite: m.cost?.cache_write || 0, }, compat: { supportsDeveloperRole: false, }, contextWindow: m.limit?.context || 4096, maxTokens: m.limit?.output || 4096, }); }}export const defaultModelPerProvider: Record<KnownProvider, string> = { // ... existing entries ... huggingface: "deepseek-ai/DeepSeek-V3.2", // Or another reasonable default};- Added Hugging Face provider support via OpenAI-compatible Inference Router ([#994](https://github.com/badlogic/pi-mono/issues/994)){ "id": "huggingface", "npm": "@ai-sdk/openai-compatible", // ← This tells us the API type "api": "https://router.huggingface.co/v1"}// OpenCode example - models can override{ "id": "claude-opus-4-1", "provider": { "npm": "@ai-sdk/anthropic" // ← Per-model SDK }}