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

@zhivex-ai/kimi

v0.7.15

Published

Kimi adapter for Zhivex AI SDK.

Readme

@zhivex-ai/kimi

Kimi adapter for Zhivex AI SDK.

Install

bun add @zhivex-ai/core @zhivex-ai/kimi

Kimi K3

kimi-k3 is the default first-class model for long-horizon coding, knowledge work, reasoning, structured output, tools, and image/video understanding.

import { generateText } from "@zhivex-ai/core";
import { createKimi } from "@zhivex-ai/kimi";

const kimi = createKimi({ apiKey: process.env.KIMI_API_KEY });

const result = await generateText({
  model: kimi("kimi-k3"),
  prompt: "Analyze this implementation and propose the safest migration.",
  reasoning: { effort: "max" },
  maxTokens: 16_384
});

K3 always reasons. reasoning.effort maps to Kimi's top-level reasoning_effort and accepts low, high, and max (max is the provider default). Other efforts, including medium and none, are rejected before the request is sent. K2.x thinking options are rejected. maxTokens maps to max_completion_tokens, whose K3 range is 1 through 1,048,576.

K3 uses fixed sampling values (temperature=1, top_p=0.95, n=1, and zero presence/frequency penalties). The adapter accepts those exact values but omits them from the request, and rejects incompatible values before calling the API.

K3's 1M-token context uses automatic server-side prefix caching. The model advertises contextCaching: true, and Kimi cached_tokens usage is normalized as usage.cachedInputTokens.

K3 accepts toolChoice: "auto", "none", or "required". Selecting one specific function is incompatible with always-on reasoning and is rejected locally. The adapter preserves reasoning_content across multi-step tool loops, including streaming calls.

Official Formula tools

Kimi official tools are exposed through Formula URIs. The SDK helpers load or declare the Formula tool schema, pass it as a Chat Completions function tool, and execute the matching Formula fiber when Kimi returns a tool call.

import { createKimi, kimiFormulaTools, kimiWebSearchTool } from "@zhivex-ai/kimi";
import { generateText } from "@zhivex-ai/core";

const kimi = createKimi({ apiKey: process.env.KIMI_API_KEY });

await generateText({
  model: kimi("kimi-k3"),
  prompt: "Search for current information and summarize it.",
  reasoning: { effort: "max" },
  maxSteps: 2,
  toolChoice: "required",
  tools: {
    web_search: kimiWebSearchTool()
  }
});

const tools = await kimiFormulaTools({
  apiKey: process.env.KIMI_API_KEY,
  formulas: ["moonshot/web-search:latest", "moonshot/fetch:latest"]
});

Formula tools require approval by default, reject unsafe Formula resource paths and prototype-sensitive remote tool names, return a prototype-free tool set, and apply a 30-second request timeout. Use requiresApproval: false only when the caller has an equivalent policy boundary. timeoutMs can set a positive timeout up to 10 minutes; caller and agent abort signals are propagated to both loaded and statically declared Formula tools.

Built-in shortcuts include kimiWebSearchTool(), kimiFetchTool(), kimiCodeRunnerTool(), kimiExcelTool(), and kimiDateTool(). Current first-class model IDs are kimi-k3, kimi-k2.7-code, kimi-k2.7-code-highspeed, and kimi-k2.6. Older ids such as kimi-k2.5, kimi-k2-0905-preview, and kimi-k2-thinking can still be passed through to the API, which documents them as retired.

Moonshot currently marks its Formula web-search tool as being updated and not recommended for near-term production workflows. The helper remains available for compatibility, but production use should follow the current upstream status.

kimi-k2.7-code and kimi-k2.7-code-highspeed always use preserved thinking mode. When common reasoning is supplied, the SDK maps it to thinking: { type: "enabled", keep: "all" }; disabled thinking, toolChoice: "required", specific forced tools, and non-default sampling controls are rejected before the request is sent. K2.6 also does not accept toolChoice: "required".

Kimi K3, K2.7 Code, and K2.6 support image and video understanding. The SDK preserves message-part order, accepts base64 data and ms:// file references, and rejects unsupported public HTTP(S) media URLs before fetch.

Repository and full documentation:

Retired model catalog entries

The Open Platform changelog documents that kimi-k2.5, the moonshot-v1 series, and the kimi-k2 series (including kimi-k2-0905-preview) return 404. Those ids are no longer in the release-managed SDK catalog. kimi-k2.6 and kimi-k2.7-code remain. Prefer kimi-k3 for new work.

See the platform changelog.