npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yourgpt/llm-sdk

v2.5.1-beta.1

Published

AI SDK for building AI Agents with any LLM

Downloads

731

Readme

@yourgpt/llm-sdk

Multi-provider LLM SDK with streaming. One API, any provider.

Installation

npm install @yourgpt/llm-sdk @anthropic-ai/sdk

For other providers (OpenAI, Google, xAI), see Providers Documentation.

Quick Start

// app/api/chat/route.ts
import { streamText } from "@yourgpt/llm-sdk";
import { anthropic } from "@yourgpt/llm-sdk/anthropic";

export async function POST(req: Request) {
  const { messages } = await req.json();

  const result = await streamText({
    model: anthropic("claude-sonnet-4-20250514"),
    system: "You are a helpful assistant.",
    messages,
  });

  return result.toTextStreamResponse();
}
# .env.local
ANTHROPIC_API_KEY=sk-ant-...

With Copilot SDK

Use createRuntime for full Copilot SDK integration with tools support:

// app/api/chat/route.ts
import { createRuntime } from "@yourgpt/llm-sdk";
import { createAnthropic } from "@yourgpt/llm-sdk/anthropic";

const runtime = createRuntime({
  provider: createAnthropic({ apiKey: process.env.ANTHROPIC_API_KEY }),
  model: "claude-sonnet-4-20250514",
  systemPrompt: "You are a helpful assistant.",
});

export async function POST(req: Request) {
  return runtime.stream(await req.json()).toResponse();
}

Selective Tool Loading

llm-sdk can now narrow tools before they reach the provider. This is opt-in and works with both local ranking and provider-native hints.

import { createRuntime, type ToolDefinition } from "@yourgpt/llm-sdk";
import { createOpenAI } from "@yourgpt/llm-sdk/openai";

const tools: ToolDefinition[] = [
  {
    name: "search_docs",
    description: "Search product docs",
    location: "server",
    category: "knowledge",
    profiles: ["support", "research"],
    searchKeywords: ["docs", "kb", "help"],
    inputSchema: { type: "object", properties: { query: { type: "string" } } },
    handler: async ({ query }) => ({ query }),
  },
  {
    name: "get_time",
    description: "Get current time",
    location: "server",
    category: "utility",
    profiles: ["utility"],
    deferLoading: true,
    inputSchema: { type: "object", properties: {} },
    handler: async () => ({ now: new Date().toISOString() }),
  },
];

const runtime = createRuntime({
  provider: createOpenAI({ apiKey: process.env.OPENAI_API_KEY }),
  model: "gpt-4o-mini",
  tools,
  agentLoop: {
    enabled: true,
    toolSelection: {
      enabled: true,
      defaultProfile: "support",
      search: {
        enabled: true,
        maxResults: 4,
        exposeWhenToolCountExceeds: 1,
      },
      dynamicSelection: { enabled: true, maxTools: 2 },
      nativeProviderHints: {
        openai: { toolChoice: "single", parallelToolCalls: false },
      },
    },
  },
});

// Request body can override the active profile:
// { "messages": [...], "toolProfile": "utility" }

When search.enabled is on, deferred tools can be discovered through a hidden search_tools server tool. Matching tools are loaded into the next loop iteration instead of sending every deferred tool definition up front.

Structured output, MCP, and reasoning effort

Pass responseFormat, mcpServers, and reasoningEffort on any generateText() / streamText() / runtime.chat() / runtime.response() call:

const result = await runtime.response({
  prompt: "Extract FAQs from this conversation.",
  mcpServers: [{ label: "kb", url: "https://kb.example.com/sse" }],
  reasoningEffort: "high",
  responseFormat: {
    type: "json_schema",
    json_schema: { name, schema, strict: true },
  },
});

OpenAI routes through /v1/responses automatically when MCP or reasoning is set; Anthropic uses the mcp-client-2025-11-20 beta and adaptive thinking on Claude 4.6/4.7. See the Structured Output guide for the full per-provider mapping.

Documentation

Visit copilot-sdk.yourgpt.ai for full documentation:

License

MIT