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

@krishivpb60/krims-code-sdk

v0.1.0

Published

Starter SDK for Krims Code CLI and IDE integrations

Readme

Krims Code SDK

A lightweight, zero-dependency, universal developer SDK for integrating with the Krims Code ecosystem and querying a wide array of AI model providers.

Key Features

  • Multi-Provider Support: Out-of-the-box wrappers for OpenAI, Google Gemini, Anthropic Claude, Cohere, Ollama (local), Groq, Together, Cerebras, Mistral, Fireworks, OpenRouter, DeepSeek, Perplexity, and xAI.
  • Unified Chat Client: Perform stateless queries across different API providers with a single, simple .ask(prompt) method.
  • Stateful Client-Side Sessions: Use KrimsSession to manage conversation histories locally. Chat histories are automatically mapped to the appropriate provider format.
  • Zero-Config Integrations: Auto-detects standard environment variables (like OPENAI_API_KEY, GOOGLE_API_KEY, etc.).
  • TypeScript Support: Native .d.ts declarations included for autocomplete and code validation.
  • Zero Dependencies: Lightweight and fast, using native fetch and standard web APIs.

Installation

npm install krims-code-sdk

Quick Start

1. Zero-Config (Using local Krims Chatbot Server)

By default, the SDK targets the local Krims Chatbot backend at http://localhost:3000.

import { createKrimsClient } from 'krims-code-sdk';

const client = createKrimsClient();

// Call local health check
const health = await client.health();
console.log('Status:', health);

// Call local Markov AI model
const res = await client.ask('Who created you?');
console.log('Response:', res.text);

2. Multi-Provider Queries (e.g. Google Gemini)

Configuring a specific provider is simple. The SDK handles formatting differences underneath.

import { createKrimsClient } from 'krims-code-sdk';

// Auto-detects process.env.GOOGLE_API_KEY
const client = createKrimsClient({
  provider: 'google', // or 'openai', 'anthropic', 'cohere', 'groq', etc.
  model: 'gemini-2.5-flash'
});

const res = await client.ask('Explain quantum computing in one sentence.');
console.log('Gemini:', res.text);

3. Stateful Chat Sessions

The stateful KrimsSession handles storing message history and appends it automatically to subsequent calls in the session.

import { createKrimsClient } from 'krims-code-sdk';

const client = createKrimsClient({
  provider: 'openai',
  apiKey: 'your-openai-api-key'
});

const session = client.createSession({
  name: 'coding-assistant',
  systemInstruction: 'You are a Senior JavaScript developer.'
});

// Turn 1
let res = await session.ask('What is closures?');
console.log(res.text);

// Turn 2 (Session maintains context of Turn 1 automatically)
res = await session.ask('Can you show me a code example?');
console.log(res.text);

// View cumulative history
console.log(session.getHistory());

API Reference

KrimsClient Options

When calling createKrimsClient(options) or new KrimsClient(options), you can configure:

| Option | Type | Description | Environment Variable Fallback | | :--- | :--- | :--- | :--- | | provider | string | The AI provider to query (e.g. openai, google, anthropic, cohere, groq, together, krims, custom). | - | | model | string | The model identifier. | Default values defined per provider | | apiKey | string | API authorization key. | OPENAI_API_KEY, GOOGLE_API_KEY, ANTHROPIC_API_KEY, etc. | | baseUrl | string | Custom root URL for the endpoints. | KRIMS_BASE_URL (for krims provider only) | | headers | object | Custom headers to append on every request. | - | | timeout | number | Timeout in milliseconds (default: 30000). | - | | fetchFn | function | Custom fetch function (for proxies or custom clients). | globalThis.fetch |


Running Tests

To run the unit tests natively in Node:

npm test