krislavten/ai-sdk-provider-dsh ↗★ 1
ai-sdk-provider-dsh
AI SDK provider that drives a DeepSeek Harness (dsh) runtime as a language model (LanguageModelV3 — works on both AI SDK v6 and v7)
AI Analysis
核心用途是让开发者能使用 Vercel AI SDK 语法直接调用 DSH 运行时。适合正在使用 AI SDK 构建应用,并希望将 DSH 作为底层模型驱动的开发者。
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗Install
npm install ai-sdk-provider-dsh
The dsh runtime is bundled: the package ships a default runtime composition (runtime/cordis.yml) plus the dsh-jsonrpc-agent bin (via @deepseek-ai/dsh-sdk-jsonrpc-demo), and all runtime plugins are pinned exact versions in dependencies. A provider instance spawns a working runtime out of the box — no separate install.
Credentials come from the runtime's environment:
export DEEPSEEK_API_KEY=sk-... # required
export DEEPSEEK_BASE_URL=https://api.deepseek.com # optional; any OpenAI-compatible gateway works
Quick Start
streamText (AI SDK v7)
import { streamText } from "ai";
import { createDsh } from "ai-sdk-provider-dsh";
const dsh = createDsh({
runtime: { provider: "deepseek-official", model: "deepseek-v4-flash" },
});
const result = streamText({
model: dsh.languageModel("deepseek-v4-flash"),
instructions: "You are a coding agent.",
prompt: "run the tests",
});
const text = await result.text;
console.log(text);
streamText (AI SDK v6)
import { streamText } from "ai";
import { createDsh } from "ai-sdk-provider-dsh";
const dsh = createDsh({ runtime: { provider: "deepseek-official", model: "deepseek-v4-flash" } });
const result = streamText({
model: dsh.languageModel("deepseek-v4-flash"),
system: "You are a coding agent.", // v6 name; v7 uses `instructions`
prompt: "run the tests",
});
generateText
import { generateText } from "ai";
import { createDsh } from "ai-sdk-provider-dsh";
const dsh = createDsh({ runtime: { provider: "deepseek-official", model: "deepseek-v4-flash" } });
const { text } = await generateText({
model: dsh.languageModel("deepseek-v4-flash"),
prompt: "say hello",
});
Provider factory
const dsh = createDsh(options); // returns the provider
dsh.languageModel("deepseek-v4-flash") // the LanguageModel
dsh("deepseek-v4-flash") // callable alias (AI SDK provider convention)
await dsh.close(); // tear down the runtime subprocess (idempotent)