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-deepinfra

v0.1.4

Published

DeepInfra provider for pi: dynamic model catalog, reasoning-effort thinking levels, vision, session usage + monthly billing footer

Readme

pi-deepinfra

A pi extension that adds the DeepInfra provider: 90+ hosted chat models (DeepSeek, Qwen, Llama, Gemma, Mistral, plus hosted frontier models like Claude and Gemini), with dynamic model discovery, reasoning-effort control, vision, and a footer statusline showing session token usage + cost and DeepInfra monthly usage.

Install

Requires pi.

  • npm (recommended):

    pi install npm:pi-deepinfra
  • git (latest source):

    pi install git:github.com/puetsua/pi-deepinfra
  1. Authenticate — either:

    • Interactive: inside pi, run /login deepinfra and paste your API key (from https://deepinfra.com/dash/api_keys). The key is stored in ~/.pi/agent/auth.json.
    • Environment: set DEEPINFRA_API_KEY in your shell.

    If a deepinfra api_key entry already exists in ~/.pi/agent/auth.json, it is picked up automatically.

  2. Restart pi (or /reload), then select a model:

    /model deepinfra/deepseek-ai/DeepSeek-V4-Flash-0731

What you get

| Feature | Notes | |---|---| | Model catalog | Registered instantly with a curated fallback list — startup never blocks on the network. The live catalog from https://api.deepinfra.com/v1/openai/models is fetched lazily at session start, swapped in over the fallback, and cached in ~/.pi/agent/cache/deepinfra-models.json so later startups register the full catalog instantly (needed by clients that select a model right after launching pi, e.g. RPC mode) — no API key required (the catalog is public), so models are ready the moment a key is added. All chat-tagged models are registered (embeddings/image/TTS/STT excluded). | | Streaming | openai-completions API; SSE streaming with reasoning_content thinking deltas on reasoning models. | | Thinking levels | reasoning_effort maps 1:1 to pi thinking levels (minimal…max); off → none. E.g. Ctrl+P or /model + thinking level cycling works as usual. | | Vision | vision-tagged models accept image input. | | Tool calling | Standard OpenAI tools/tool_choice. | | Cost tracking | Input/output/cache prices from the catalog ($ per 1M tokens, cache_read_tokens when DeepInfra publishes it). Override per model in ~/.pi/agent/models.json if needed. | | Footer statusline | While a DeepInfra model is active: ↑12.3k ↓4.5k · $0.042 for session tokens+cost, plus M: $12.34 / $50.00 for DeepInfra monthly usage when a spending limit is configured (via /payment/config), or M: $12.34 otherwise. The session figures count only assistant usage attributed to the DeepInfra provider, so switching to another model/provider mid-session never mixes their tokens/cost into these totals. Refresh with /deepinfra-billing. |

Commands

  • /deepinfra-billing — refresh the monthly-usage figure in the footer (also refreshed on session start / model select; no background polling).

Configuration

  • API key: /login deepinfra, DEEPINFRA_API_KEY, or the auth.json credential.

  • Per-model overrides (prices, context, max tokens): standard pi ~/.pi/agent/models.json mechanism, e.g.:

    {
      "deepinfra": {
        "models": [
          {
            "id": "deepseek-ai/DeepSeek-V4-Flash-0731",
            "cost": { "input": 0.09, "output": 0.18, "cacheRead": 0.018, "cacheWrite": 0 }
          }
        ]
      }
    }

    Note: models.json deepinfra entries replace the extension's models for that provider — set a full models list there if you use it.