pi-mono/packages/ai/src/providers/ollama-cloud.ts
Armin Ronacher 63dfe49bfa feat(ai,coding-agent): add DeepInfra, Nebius, Ollama Cloud, Scaleway, SiliconFlow, and StepFun providers
Adds deepinfra, nebius, ollama-cloud, scaleway, siliconflow, siliconflow-cn, stepfun, and stepfun-cn from models.dev. Hosts without verified support for OpenAI-only request features leave out store, developer messages, long cache retention, and max_completion_tokens, and send reasoning_effort only where models.dev lists effort levels. SiliconFlow toggles thinking with enable_thinking; StepFun uses DeepSeek-style reasoning.
2026-10-28 11:06:14 +01:00

15 lines
595 B
TypeScript

import { openAICompletionsApi } from "../api/openai-completions.lazy.ts";
import { envApiKeyAuth } from "../auth/helpers.ts";
import { createProvider, type Provider } from "../models.ts";
import { OLLAMA_CLOUD_MODELS } from "./ollama-cloud.models.ts";
export function ollamaCloudProvider(): Provider<"openai-completions"> {
return createProvider({
id: "ollama-cloud",
name: "Ollama Cloud",
baseUrl: "https://ollama.com/v1",
auth: { apiKey: envApiKeyAuth("Ollama Cloud API key", ["OLLAMA_API_KEY"]) },
models: Object.values(OLLAMA_CLOUD_MODELS),
api: openAICompletionsApi(),
});
}