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

loka-ai-router

v0.0.0-beta.20260926.fd08b17

Published

AI router lokal OAuth + API key untuk semua provider AI

Readme

🌿 Loka AI Router

One endpoint for all AI providers. Self-hosted, zero telemetry, OAuth + API key.

🌐 Languages: English · Bahasa Indonesia · Español · 한국어

Loka is a local AI router that unifies OpenAI, Anthropic, Gemini, Groq, DeepSeek, and 15+ other providers into a single OpenAI-compatible endpoint. Works with Claude Code, Codex CLI, OpenCode, Cursor, Cline, or any app that supports the OpenAI API.


✨ Features

  • OpenAI-compatible API — /v1/chat/completions, /v1/messages, /v1/models
  • Multi-provider OAuth — Codex, Claude, Gemini CLI, GitHub Copilot (device flow)
  • 15+ API key providers — Groq, xAI, DeepSeek, Mistral, OpenRouter, Together, Fireworks, Perplexity, Cerebras, xKiro, and more
  • Combo fallback — automatic provider chain when the first one fails
  • Cloudflare Tunnel — expose to the internet in one click, free
  • CLI Connector — auto-configure Claude Code, Codex CLI, OpenCode, Gemini CLI
  • RTK Token Saver — compress tool output by 20–40% before sending to LLM
  • Local dashboard — manage everything from the browser
  • Zero telemetry — all data stays on your machine
  • Cache + rate limit — built in, just enable it

🚀 Quick Start

Install

npm install -g loka-ai-router

Or without installing:

npx loka-ai-router

Run

loka

Open http://localhost:1455 in your browser.

First-time setup

  • Open the Providers page
  • OAuth Providers — click a provider → Connect OAuth (log in once, done)
  • Regular Providers — click a provider → Add API Key → paste key from the provider console
  • Click Test on a model to verify

Use in other apps

  • Base URL: http://localhost:1455/v1
  • API Key: from the API Keys page in the dashboard
  • Model: pick from the list on the Providers page

📋 Providers

OAuth (browser login)

| Provider | Models | |---|---| | OpenAI Codex | gpt-5.6, gpt-5.5, gpt-5.4 | | Anthropic | claude-opus-4-5, claude-sonnet-4-5 | | Google Gemini CLI | gemini-2.5-pro, gemini-2.5-flash | | GitHub Copilot | gpt-5, claude-sonnet-4-5 |

API Key

| Provider | Get key at | |---|---| | Groq | <console.groq.com/keys> | | xAI | <console.x.ai> | | DeepSeek | <platform.deepseek.com> | | Mistral | <console.mistral.ai> | | OpenRouter | <openrouter.ai/keys> | | Together | <api.together.ai> | | Fireworks | <fireworks.ai> | | Perplexity | <perplexity.ai> | | Cerebras | <cloud.cerebras.ai> | | xKiro | <xkiro.com> | | Ollama | Local, free, no key needed |

All API key providers support Import Models — fetch the full model list automatically.

🔌 CLI Connector

The CLI Connector page detects AI CLIs installed on your machine and writes their config automatically.

Supported:

  • Claude Code
  • Codex CLI
  • OpenCode
  • Gemini CLI

How to use:

  1. Install the CLI first (guide shown automatically if not installed)
  2. Open /cli in the dashboard
  3. Click Configure for Loka
  4. Pick endpoint, model, or combo
  5. Done — the CLI now points to Loka

🌐 Tunnel

The Tunnel page exposes Loka to the internet without opening your router:

  • Local Network — access from another device on the same WiFi
  • Cloudflare Tunnel — free public HTTPS URL, one-click setup
  • Ngrok — alternative, requires an account

⚙️ Configuration

Everything lives in loka.json:

{
  "port": 1455,
  "host": "0.0.0.0",
  "cooldownMs": 60000,
  "maxRetries": 2,
  "rtk": { "enabled": true },
  "cache": { "enabled": true, "ttlMs": 300000 },
  "rateLimit": { "enabled": true, "maxRequests": 120 }
}

Edit via the Settings page in the dashboard, or edit the file directly.

🛠️ Development

git clone https://github.com/noxaascript/Loka.git
cd Loka
npm install
npm run dev

Open http://localhost:1455.

📄 Structure

loka/
├── index.js              # Entry point
├── setup.mjs             # Installer + launcher
├── loka.json             # Config
├── lib/
│   ├── server.js         # HTTP server
│   ├── router.js         # Routing engine
│   ├── api/              # Endpoints
│   ├── oauth/            # OAuth providers
│   ├── upstream/         # Provider callers
│   ├── translate/        # Format converters
│   ├── tools/            # RTK, compactor
│   └── ui/               # Dashboard pages
└── data/                 # Logs, stats, cache

⚠️ Notes

  • Anthropic OAuth — uses your Claude Pro/Max subscription. Using it outside Claude Code violates Anthropic's ToS. Use at your own risk.
  • Codex OAuth — requires a ChatGPT Plus/Pro account.
  • xAI OAuth — blocked by Cloudflare for bare HTTP. Use an API key instead.
  • RTK — works out of the box, but shines when you use tool calling.

🤝 Contributing

PRs, issues, and feedback are welcome. Open an issue at GitHub or fork the repo.

📜 License

MIT © 2026 Loka Contributors

🌟 Credits