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

@obsku/provider-ai-sdk

v0.2.3

Published

AI SDK provider adapter for @obsku/framework

Downloads

398

Readme

@obsku/provider-ai-sdk

Vercel AI SDK provider adapter for @obsku/framework. Use any AI SDK-compatible model as an obsku LLMProvider.

Installation

npm install @obsku/provider-ai-sdk

Quick Start

Provider Factories (Recommended)

import { agent } from "@obsku/framework";
import { openai, anthropic, google, groq } from "@obsku/provider-ai-sdk";

// OpenAI
const provider = openai({ model: "gpt-4o" });

// Anthropic
const provider = anthropic({ model: "claude-sonnet-4-20250514" });

// Anthropic with Extended Thinking
const provider = anthropic({
  model: "claude-opus-4",
  thinkingBudgetTokens: 10000,
});

// Google
const provider = google({ model: "gemini-2.0-flash" });

// Groq
const provider = groq({ model: "llama-3.3-70b" });

const assistant = agent({
  name: "assistant",
  prompt: "You are a helpful assistant.",
});

const result = await assistant.run("Hello!", provider);

Generic Adapter

Use fromAiSdk() to wrap any LanguageModelV1:

import { fromAiSdk } from "@obsku/provider-ai-sdk";
import { createOpenAI } from "@ai-sdk/openai";

const openai = createOpenAI({ apiKey: "..." });
const provider = fromAiSdk(openai("gpt-4o"), {
  contextWindowSize: 128000,
  maxOutputTokens: 16384,
});

API Reference

Factories

| Function | Config | Description | |----------|--------|-------------| | openai(config) | BaseProviderConfig | OpenAI models via @ai-sdk/openai | | anthropic(config) | AnthropicProviderConfig | Anthropic models with optional Extended Thinking | | google(config) | BaseProviderConfig | Google Gemini models via @ai-sdk/google | | groq(config) | BaseProviderConfig | Groq models via @ai-sdk/groq |

fromAiSdk(model, config?)

Wraps any AI SDK LanguageModelV1 as an obsku LLMProvider.

Config Types

interface BaseProviderConfig {
  model: string;
  contextWindowSize?: number;
  maxOutputTokens?: number;
}

interface AnthropicProviderConfig extends BaseProviderConfig {
  thinkingBudgetTokens?: number;  // Enables Extended Thinking
}

interface AdapterConfig {
  contextWindowSize?: number;     // Default: auto-resolved from model registry
  maxOutputTokens?: number;
  providerOptions?: Record<string, unknown>;
}

Model Resolution

Context window sizes and max output tokens are resolved via the framework's ModelRegistry (LiteLLM-backed). Pass explicit values to override:

const provider = await openai({
  model: "gpt-4o",
  contextWindowSize: 128000,
  maxOutputTokens: 16384,
});

Environment Variables

API keys are managed by the AI SDK packages:

  • OPENAI_API_KEY — OpenAI
  • ANTHROPIC_API_KEY — Anthropic
  • GOOGLE_GENERATIVE_AI_API_KEY — Google
  • GROQ_API_KEY — Groq

License

MIT