Production-ready AI Copilots for any product. Connect any LLM, deploy on your infrastructure, own your data. Built for speed and control.
npm install @yourgpt/copilot-sdk @yourgpt/llm-sdk openaiimport { CopilotProvider } from "@yourgpt/copilot-sdk/react";
import { CopilotChat } from "@yourgpt/copilot-sdk/ui";
import "@yourgpt/copilot-sdk/ui/styles.css";
function App() {
return (
<CopilotProvider runtimeUrl="/api/chat">
<YourApp />
<CopilotChat />
</CopilotProvider>
);
}// app/api/chat/route.ts
import { streamText } from "@yourgpt/llm-sdk";
import { openai } from "@yourgpt/llm-sdk/openai";
export async function POST(req: Request) {
const { messages } = await req.json();
const result = await streamText({
model: openai("gpt-4o"),
system: "You are a helpful assistant.",
messages,
});
return result.toTextStreamResponse();
}Use any LLM provider with a unified API:
import { streamText } from "@yourgpt/llm-sdk";
import { openai } from "@yourgpt/llm-sdk/openai";
import { anthropic } from "@yourgpt/llm-sdk/anthropic";
import { google } from "@yourgpt/llm-sdk/google";
import { xai } from "@yourgpt/llm-sdk/xai";
// OpenAI
await streamText({ model: openai("gpt-4o"), messages });
// Anthropic
await streamText({ model: anthropic("claude-sonnet-4-20250514"), messages });
// Google Gemini (uses OpenAI-compatible API)
await streamText({ model: google("gemini-2.0-flash"), messages });
// xAI Grok (uses OpenAI-compatible API)
await streamText({ model: xai("grok-3-fast-beta"), messages });| Provider | SDK Required |
|---|---|
| OpenAI, Google, xAI | openai |
| Anthropic | @anthropic-ai/sdk |
Add tools to let the AI call functions on your server:
import { streamText, tool } from "@yourgpt/llm-sdk";
import { openai } from "@yourgpt/llm-sdk/openai";
import { z } from "zod";
const result = await streamText({
model: openai("gpt-4o"),
messages,
tools: {
getWeather: tool({
description: "Get current weather for a city",
parameters: z.object({
city: z.string().describe("City name"),
}),
execute: async ({ city }) => {
const data = await fetchWeatherAPI(city);
return { temperature: data.temp, condition: data.condition };
},
}),
},
maxSteps: 5,
});
return result.toDataStreamResponse();| Package | Description |
|---|---|
@yourgpt/copilot-sdk/react |
React hooks and provider |
@yourgpt/copilot-sdk/ui |
Pre-built chat components |
@yourgpt/copilot-sdk/core |
Core utilities and context capture tools |
@yourgpt/llm-sdk |
Multi-provider LLM SDK with streaming |
Visit copilot-sdk.yourgpt.ai for full documentation.
Have any feedback? Share it with us.