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

pi-chutes

v1.2.0

Published

Pi coding agent extension to integrate Chutes.ai as a provider.

Readme

Pi Chutes Extension

A pi coding agent extension that provides access to models from Chutes.ai, a platform offering various open and proprietary LLM models via an OpenAI-compatible API.

Features

  • Automatic Model Discovery: Fetches the latest models from Chutes.ai on every startup
  • Offline Fallback: Uses cached models from previous fetch if API is unreachable
  • Multiple Input Types: Supports both text-only and vision (text + image) models
  • Reasoning Detection: Automatically identifies models with reasoning capabilities
  • Cost Tracking: Preserves pricing information from the API
  • Secure API Key Storage: Stores keys as api_key type with atomic writes and rollback

Installation

Option 1: npm (recommended)

pi install npm:pi-chutes

Then restart pi.

Option 2: Git

pi install git:github.com/mark182es/pi-chutes

Then restart pi.

Option 3: Manual

  1. Create the directory:

    mkdir -p ~/.pi/agent/extensions/pi-chutes
  2. Copy or create the index.ts file in that directory

Quick Start

After the extension is loaded:

# 1. Login with your API key (select Chutes.ai from the list)
/login

# 2. Select a model
/model chutes

That's it. Models are fetched automatically on every pi startup.

Usage

Login

Use the standard /login command to authenticate:

/login

Select Chutes.ai from the provider list and enter your API key when prompted (format: cpk_...). The key will be:

  1. Validated for correct format
  2. Verified against the Chutes API
  3. Saved securely to ~/.pi/agent/auth.json

To logout and clear credentials:

/logout chutes

Model Selection

Use the /model command to select a chutes model:

/model chutes

This will show all available chutes models in the model selector.

Automatic Model Updates

Models are fetched automatically from the Chutes API every time pi starts. No manual update command is needed. If the API is unreachable, cached models from the previous fetch are used instead.

The model cache is stored at ~/.pi/agent/extensions/pi-chutes/models.json.

Configuration

Option 1: Using /login (Recommended)

/login

Select Chutes.ai from the provider list and enter your API key. This integrates with pi's built-in authentication system.

Option 2: Environment Variable

| Variable | Description | | ---------------- | -------------------------- | | CHUTES_API_KEY | Your API key for chutes.ai |

export CHUTES_API_KEY=cpk_...

Option 3: Auth File

Manually add your API key to ~/.pi/agent/auth.json:

{
  "chutes": { "type": "api_key", "key": "cpk_..." }
}

Model Properties

The extension automatically converts these properties from the Chutes API:

| API Field | Model Property | Description | | ----------------------------------------- | ---------------- | --------------------------------- | | id | id | Model identifier | | id | name | Display name | | supported_features includes "reasoning" | reasoning | Supports extended thinking | | input_modalities | input | ["text"] or ["text", "image"] | | pricing.prompt | cost.input | Input cost per 1M tokens | | pricing.completion | cost.output | Output cost per 1M tokens | | pricing.input_cache_read | cost.cacheRead | Cache read cost per 1M tokens | | context_length / max_model_len | contextWindow | Context window size | | max_output_length | maxTokens | Maximum output tokens |

Files

  • index.ts — Main extension code
  • ~/.pi/agent/extensions/pi-chutes/models.json — Cached models (auto-created)

Troubleshooting

"API key contains invalid characters" error

Make sure you're entering your full API key including dots (e.g., cpk_xxx.yyy.zzz). The key format uses dot-separated segments.

"API key is invalid or unauthorized" error

  • Verify your API key is correct and active at chutes.ai
  • Make sure the key hasn't been revoked
  • Try logging in again with /login

Models not appearing

  • Models are fetched automatically on startup — just restart pi
  • If offline, cached models from the last successful fetch are used
  • Check your internet connection if models seem outdated

Startup is slow

The extension fetches models from the Chutes API on startup. If the API is slow to respond, pi will take a moment longer to start. The fetched models are cached, so offline startups use the cache instantly.

Migrating from a previous version

If you previously used an older version of this extension that stored credentials in OAuth format, they will be automatically migrated to the proper api_key format on startup. No action needed.

Security

API Key Validation

  • API keys are validated for length (16-512 characters)
  • Only alphanumeric characters, dots, hyphens, and underscores are allowed (matching Chutes.ai key format: cpk_<hex>.<hex>.<base64>)
  • Invalid keys are rejected before saving

API Key Verification

  • The /login flow verifies your API key against the Chutes API before accepting it
  • This prevents storing invalid keys that would fail at runtime

Secure Credential Storage

  • API keys are stored as type: "api_key" in auth.json (not as OAuth credentials)
  • Credentials are written to a temporary file first, then atomically renamed
  • File permissions are set to 0600 (owner read/write only)
  • Write failures include automatic rollback to prevent corrupted auth files

Automatic Migration

  • Legacy OAuth-type credentials are automatically converted to api_key format on startup

Model Data Validation

  • All model data from the API is validated before registration
  • Invalid or malformed models are filtered out

License

This extension is provided as-is for use with pi coding agent.