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

@gitkraken/ai-provider-tools

v0.1.1

Published

AI text generation for GitKraken client SDKs: GitKraken-hosted and BYOK (Anthropic, OpenAI, OpenRouter, Ollama) providers behind one model port.

Readme

@gitkraken/ai-provider-tools

AI text generation for GitKraken client SDKs: the GitKraken-hosted backend and BYOK providers (Anthropic, OpenAI, OpenRouter, Ollama) behind one model port.

Install

pnpm add @gitkraken/ai-provider-tools

Usage

import { createModel } from '@gitkraken/ai-provider-tools';
import { generateCommitMessage } from '@gitkraken/ai-provider-tools/generators';

const config = {
  provider: 'gitkraken' as const,
  getToken: async () => authStore.accessToken,
  organizationId: currentOrg.id,
};

const model = createModel(config);
const { text } = await model.generate({ messages: [{ role: 'user', content: 'hi' }] });

const { message, description } = await generateCommitMessage(config, diff);

runPromptCompletion(config, action, variables) (root export) runs any server-side prompt template by its task action name and returns { text, usage?, finishReason?, rawFinishReason?, model? }; the ./generators subpath wraps it for commit messages, pull requests, change explanations and changelogs, each result carrying the completion's usage when the provider reports it.

A BYOK provider looks the same, minus the GitKraken-only fields:

const model = createModel({ provider: 'anthropic', apiKey, model: 'claude-sonnet-4-5' });

Model port

createModel's result is a Model whose generate accepts either shared-tools' AiGenerateParams or a tool-aware superset of it (system/messages/tools/maxTokens/ temperature/signal), and is assignable to both @gitkraken/shared-tools' AiModelPort and @gitkraken/conflict-tools' ConflictModelPort — see ARCHITECTURE.md and src/model-port.type.test.ts.

generate resolves to { text, toolCalls?, usage?, finishReason?, rawFinishReason?, model? }. finishReason is provider-neutral (stop, length, tool-calls, content-filter, error, other), rawFinishReason is the provider's exact value, and model is the model id the response reports.

Errors

Every operation throws AiError on failure: { code, message, retryable, status?, providerErrorCode?, providerErrorType?, details? }. status is the HTTP status, and providerErrorCode/providerErrorType are the raw code/type of the provider's error body. code is one of credits_exhausted, not_logged_in, rate_limited, invalid_request, provider_error, truncated_output. User aborts are rethrown unchanged rather than wrapped. See ARCHITECTURE.md for the mapping.

What the host owns

getToken, fetch, request (an @gitkraken/api-tools ApiRequest), getCreditUsage, onCreditUsage, and telemetry are all injected. This package never reads process.env, writes through a StoragePort, or caches a model list — see ARCHITECTURE.md.