Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use Deepshi models with the Vercel AI SDK.
npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { generateText } from "ai"; const deepshi = createOpenAICompatible({ name: "deepshi", baseURL: "https://api.deepshi.ai/v1", apiKey: process.env.DEEPSHI_API_KEY, }); const { text } = await generateText({ model: deepshi("deepshi-3.0"), prompt: "Write a haiku about the sea.", }); console.log(text);
streamText
import { streamText } from "ai"; const result = streamText({ model: deepshi("deepshi-3.0"), prompt: "Explain backpropagation.", }); for await (const chunk of result.textStream) { process.stdout.write(chunk); }
deepshi-3.0