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

@verioussmith/pi-openrouter

v1.1.0

Published

OpenRouter provider extension for Pi Coding Agent - access 20+ LLM models through unified API

Readme

Pi OpenRouter Extension

npm version License: MIT

OpenRouter provider extension for Pi Coding Agent.

Features

  • 🚀 Access 20+ LLM models through OpenRouter's unified API
  • 🔄 OpenAI-compatible streaming
  • 🤖 Supports Claude, GPT-4, Gemini, Llama, Mistral, DeepSeek, Perplexity
  • 🆓 Free models available (Gemini 2.0 Flash)
  • 📦 One-command installation via npm
  • ⚡ Auto-installs to ~/.pi/agent/extensions/

Installation

Quick Install (Recommended)

npm install -g @verioussmith/pi-openrouter

That's it! The extension automatically installs to ~/.pi/agent/extensions/openrouter.ts

Alternative Methods

See INSTALL.md for manual installation options.

Configuration

Set your OpenRouter API key in ~/.zshrc or environment:

export OPENROUTER_API_KEY="sk-or-v1-YOUR_KEY_HERE"

Get your key at: https://openrouter.ai/settings/keys

Usage

# Start pi
pi

# List available models
/model

# Select an OpenRouter model
/model openrouter/google/gemini-2.0-flash-exp:free

# Or any other model
/model openrouter/anthropic/claude-3.5-sonnet
/model openrouter/openai/gpt-4o
/model openrouter/deepseek/deepseek-r1

Available Models

Free Tier

  • google/gemini-2.0-flash-exp:free - Gemini 2.0 Flash Experimental
  • google/gemini-2.0-flash-thinking-exp:free - Gemini 2.0 Flash with reasoning

Anthropic

  • anthropic/claude-3.5-sonnet - Claude 3.5 Sonnet
  • anthropic/claude-3-opus - Claude 3 Opus
  • anthropic/claude-3-haiku - Claude 3 Haiku

OpenAI

  • openai/gpt-4o - GPT-4o
  • openai/gpt-4o-mini - GPT-4o Mini
  • openai/o1 - O1 (reasoning model)
  • openai/o1-mini - O1 Mini

Google

  • google/gemini-pro-1.5 - Gemini Pro 1.5

Meta

  • meta-llama/llama-3.3-70b-instruct - Llama 3.3 70B
  • meta-llama/llama-3.1-405b-instruct - Llama 3.1 405B

Mistral

  • mistralai/mistral-large - Mistral Large
  • mistralai/mistral-small - Mistral Small

DeepSeek

  • deepseek/deepseek-chat - DeepSeek Chat
  • deepseek/deepseek-r1 - DeepSeek R1 (reasoning)

Perplexity

  • perplexity/sonar-pro - Sonar Pro

See all models: https://openrouter.ai/models

Adding More Models

Edit openrouter.ts and add to the models array:

{
  id: "provider/model-name",
  name: "Display Name (OpenRouter)",
  reasoning: false, // true for reasoning models
  input: ["text", "image"], // or just ["text"]
  cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
  contextWindow: 128000,
  maxTokens: 4096,
}

Costs are in $/million tokens. Check https://openrouter.ai/models for pricing.

Development

# Clone
git clone https://github.com/verioussmith/pi-openrouter-extension.git
cd pi-openrouter-extension

# Install in Pi (development mode)
ln -s $(pwd)/openrouter.ts ~/.pi/agent/extensions/openrouter.ts

# Test
pi
/model openrouter/google/gemini-2.0-flash-exp:free

Publishing Updates

# Update version in package.json
npm version patch  # or minor, major

# Commit and push
git add . && git commit -m "chore: bump version" && git push

# Publish to npm (requires OTP)
npm publish --access public --otp=YOUR_OTP

Package Links

  • npm: https://www.npmjs.com/package/@verioussmith/pi-openrouter
  • GitHub: https://github.com/verioussmith/pi-openrouter-extension
  • Issues: https://github.com/verioussmith/pi-openrouter-extension/issues

References

Contributing

Contributions welcome! Please:

  1. Fork the repo
  2. Create a feature branch
  3. Submit a pull request

Author

Verious Smith (@verioussmith)

License

MIT - see LICENSE file for details