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

@rolemodel/pi-omlx

v0.0.2

Published

Auto-discovers models from an omlx endpoint and provides a UI to toggle model visibility

Downloads

792

Readme

@rolemodel/omlx — Dynamic oMLX Model Discovery

This extension auto-discovers models from an oMLX (OpenAI-compatible) endpoint and registers them with the pi provider system. It provides an interactive UI via /omlx-models to toggle model visibility — hide models you don't need without deleting configuration. It is an alias layer on top of pi's provider system: it fetches available models from your omlx server, registers them, and lets you show/hide them interactively.

Table of Contents


Quick Start

# Install this extension
pi install npm:@rolemodel/pi-omlx

Set up your omlx provider in ~/.pi/agent/models.json with your API key and endpoint:

{
  "providers": {
    "omlx": {
      "baseUrl": "http://localhost:8000/v1",
      "apiKey": "<api-key>",
      "autoDiscover": true
    }
  }
}

Reload and start using discovered models:

/reload

Provider Configuration

The extension looks for an omlx provider entry under providers in ~/.pi/agent/models.json. Create the file if it doesn't exist, or add the omlx key to an existing providers object.

Minimal Setup (Authentication)

The only required fields for authentication are baseUrl and apiKey:

{
  "providers": {
    "omlx": {
      "baseUrl": "http://localhost:8000/v1",
      "apiKey": "<api-key>"
    }
  }
}

The apiKey is the credential used to authenticate requests to your omlx server. Visit the admin dashboard for oMLX and navigate to the global settings to find the api key or check "Skip API key verification" to by pass security check.

In oMLX it is possible to disable API key verification which would allow omitting the API key from the config file. This is not recommended when exposing oMLX to the internet but is perfectly fine for local use.

Full Configuration

{
  "providers": {
    "omlx": {
      "baseUrl": "http://localhost:8000/v1",
      "apiKey": "<api-key>",
      "api": "openai-completions",
      "autoDiscover": true,
      "excludePatterns": [],
      "modelOverrides": {},
      "defaultContextWindow": 256000,
      "defaultMaxTokens": 56000
    }
  }
}

Model Visibility Command

Run /omlx-models to open an interactive panel that lists all discovered models with their visibility status. This toggles the model's inclusion in the /model selector to limit visible models and narrow down long lists of downloaded models.

oMLX Model Visibility
────────────────────────────
> [✓] llama-3-70b-instruct
  [✓] mistral-large-24b
  [✓] phi-3-mini
  [✗] tiny-model-not-needed
  [✓] custom-finetuned-model

          [Cancel]            [Save]
↑↓ navigate • enter toggle/save • esc cancel
  • ↑↓ — Navigate the list
  • Enter — Toggle a model's visibility (✓ = visible, ✗ = hidden)
  • [Save] — Write the changes back to ~/.pi/agent/models.json
  • [Cancel] — Discard changes and exit
  • Escape — Exit without saving

The extension respects exclusion patterns (see below), so models excluded by glob rules appear pre-hidden in the UI.


Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | baseUrl | string | http://localhost:8000/v1 | The omlx server endpoint. Must include the /v1 prefix for OpenAI-compatible API. | | apiKey | string | (none) | Required. Your API key for authenticating requests. Stored in ~/.pi/agent/models.json. | | api | string | "openai-completions" | The API mode to use. Determines how requests are formatted when calling the endpoint. | | autoDiscover | boolean | true | When true, the extension fetches available models from GET /v1/models on startup and on /reload. Set to false to skip discovery. | | excludePatterns | string[] | [] | Glob patterns to exclude specific models from discovery and the visibility list. | | modelOverrides | object | {} | Per-model overrides to customize properties like name, contextWindow, maxTokens, cost, etc. | | defaultContextWindow | number | 256000 | Default context window in tokens for discovered models that don't specify one. | | defaultMaxTokens | number | 56000 | Default max output tokens for discovered models. |


Model Overrides

When you need custom properties for a specific model (e.g., a finetuned model with a smaller context window or a multimodal model), add it to modelOverrides keyed by model ID:

{
  "providers": {
    "omlx": {
      "baseUrl": "http://localhost:8000/v1",
      "apiKey": "<api-key>",
      "modelOverrides": {
        "custom-llama-70b": {
          "name": "Custom Llama 70B",
          "contextWindow": 128000,
          "maxTokens": 8192,
          "reasoning": true,
          "input": ["text", "image"],
        },
        "custom-mistral-8x7b": {
          "name": "Mistral 8x7B MoE",
          "maxTokens": 4096,
          "thinkingLevelMap": {
            "minimal": null,
            "low": null,
            "medium": "medium",
            "high": "high",
            "xhigh": null
          }
        }
      }
    }
  }
}

Available Override Properties (including thinkingLevelMap)

| Property | Type | Default | Description | |----------|------|---------|-------------| | name | string | Model ID | Display name shown in the model selector. | | reasoning | boolean | false | Whether this is a reasoning model (affects prompt formatting). | | input | string[] | ["text"] | Supported input modalities. Use ["text", "image"] for multimodal. | | contextWindow | number | defaultContextWindow | Max context tokens. | | maxTokens | number | defaultMaxTokens | Max output tokens. | | thinkingLevelMap | object | defaultThinkingLevelMap | Map pi thinking levels to provider effort values. Set to null to hide. | | api | string | (inherited) | API override for this specific model. | | headers | object | {} | Additional HTTP headers to include in requests for this model. | | compat | string | (none) | Compatibility mode string. |

Overrides are applied after discovery, so they work for both discovered models and manually listed ones.


Exclusion Patterns

Use excludePatterns to filter out models you never want to see — models matching these patterns will be excluded from discovery and hidden by default in the visibility UI.

Patterns support glob syntax (* and ? wildcards). To exclude a specific model by exact ID, wrap it with ^ and $:

/omlx-models is the best way to customize this but manual globs can be added to.

Here's some examples:

  • ^tiny-model$ — excludes only the model with the exact ID tiny-model
  • gpt-4-32k* — excludes all models starting with gpt-4-32k
  • *-instruct-* — excludes all models containing instruct anywhere in the ID