deepseekProvider (providers/deepseek.ts)

pi-mono · packages/ai/src/providers/deepseek.ts · typescript · MIT
ai, tag:knn-classified

Provider factory for DeepSeek OpenAI‑compatible API.

// Source: https://github.com/badlogic/pi-mono | License: MIT | Copyright 2025 Mario Zechner
// Provided via justclaw.it.com; keep this notice with the code.
import { openAICompletionsApi } from "../api/openai-completions.lazy.ts";
import { envApiKeyAuth } from "../auth/helpers.ts";
import { createProvider, type Provider } from "../models.ts";
import { DEEPSEEK_MODELS } from "./deepseek.models.ts";

export function deepseekProvider(): Provider<"openai-completions"> {
	return createProvider({
		id: "deepseek",
		name: "DeepSeek",
		baseUrl: "https://api.deepseek.com",
		auth: { apiKey: envApiKeyAuth("DeepSeek API key", ["DEEPSEEK_API_KEY"]) },
		models: Object.values(DEEPSEEK_MODELS),
		api: openAICompletionsApi(),
	});
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key