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

@codeworksh/aikit

v0.6.0

Published

TypeScript SDK that provides a unified API for working with multiple LLM providers, automatic model discovery, and more.

Readme

@codeworksh/aikit

AiKit is TypeScript SDK that provides a unified API for working with multiple LLM providers, automatic model discovery, provider configurations, token and cost tracking, and mid-session hand-off to other models. It gives you the basic primitives for streaming LLM responses without the extra bloat, letting you handle the orchestration yourself.

Table of Contents

Installation

npm install @codeworksh/aikit

Node >=22.0.0 is required.

Supported Providers

Built on top of the Vercel AI SDK, @codeworksh/aikit supports a wide array of providers natively:

  • Anthropic (@ai-sdk/anthropic)
  • OpenAI (@ai-sdk/openai)
  • Google (@ai-sdk/google)
  • Google Vertex AI (@ai-sdk/google-vertex)
  • xAI (@ai-sdk/xai)
  • OpenRouter (@openrouter/ai-sdk-provider)
  • OpenAI Compatible APIs (@ai-sdk/openai-compatible)

Quick Start

import { llm, stream, Message } from "@codeworksh/aikit";

// Resolve a model from the built-in registry
const model = await llm("anthropic", "claude-haiku-4-5-20251001");
if (!model) throw new Error("Model not found");

// Setup conversation context
const context: Message.Context = {
	systemPrompt: "You are a helpful coding assistant.",
	messages: [
		Message.createUserMessage({
			role: "user",
			time: { created: Date.now() },
			parts: [{ type: "text", text: "Write a simple loop in TypeScript." }],
		}),
	],
};

// Option 1: Stream events
const s = stream(model, context, { apiKey: process.env.ANTHROPIC_API_KEY });

for await (const event of s) {
	if (event.type === "text.delta") {
		process.stdout.write(event.delta);
	}
}

const finalMessage = await s.result();
console.log(`\nMessage ID: ${finalMessage.messageId}`);

// Option 2: Get complete response without streaming
const message = await stream.complete(model, context, { apiKey: process.env.ANTHROPIC_API_KEY });
console.log(message.parts);

Tools

Tools enable LLMs to interact with external systems. @codeworksh/aikit provides native support for function calling and schema validation using TypeBox.

import { Type, llm, stream, Message, validateToolArguments } from "@codeworksh/aikit";

const calculatorTool = {
	name: "calculator",
	description: "Evaluate arithmetic expressions",
	parameters: Type.Object({
		expression: Type.String(),
	}),
};

const context: Message.Context = {
	messages: [
		Message.createUserMessage({
			role: "user",
			time: { created: Date.now() },
			parts: [{ type: "text", text: "What is 25 * 18?" }],
		}),
	],
	tools: [calculatorTool],
};

const response = await stream.complete(model, context, { apiKey: process.env.ANTHROPIC_API_KEY });

// Check for tool calls in the response
for (const part of response.parts) {
	if (part.type === "toolCall") {
		console.log(`Executing tool: ${part.name}`);

		// Validates arguments against TypeBox schema automatically
		const args = validateToolArguments(calculatorTool.parameters, part.arguments);
		// Execute your tool logic here...
	}
}

Providers and Models

@codeworksh/aikit uses a registry to fetch model specifications and metadata.

import { llm } from "@codeworksh/aikit";

// Get all available providers
const providers = await llm.providers();
console.log(providers);

// Get all models for a specific provider
const anthropicModels = await llm.models("anthropic");

// Get a specific model directly
const gpt4 = await llm.model("openai", "gpt-4o");

CLI Tools

@codeworksh/aikit ships with a CLI tool for managing local metadata and authentication.

You can invoke it using npx aikit or pnpm aikit.

Model Generation

Generate a models.gen.json file fetching the latest metadata about providers and their available models from models.dev.

pnpm aikit modelgen [path]

OAuth Providers

Manage OAuth credentials for providers that require it, such as OpenAI Codex.

# Start an OAuth login flow in your browser
pnpm aikit auth --openai-codex

# Check the status of your stored credentials
pnpm aikit auth --openai-codex --status

# Refresh your current credentials
pnpm aikit auth --openai-codex --refresh

# Clear stored credentials
pnpm aikit auth --openai-codex --logout

Contribute

@codeworksh/aikit is open to community contribution. Please ensure you submit an issue before submitting a pull request. The project prefers open community discussion before accepting new features.