omp packages

@jocax/model-identity0.2.1

Extension for identifying distilled LLM models and preventing confusion between Claude-based model variants

jocax Published 4 days ago MIT ~150 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

model-identity

A Pi package for supporting distilled LLM model identification.

Purpose

This package provides mechanisms to identify and handle distilled LLM models like Claude Opus Distilled v2 or Gemma 4 31B in the AE-PI ecosystem.

Features

  • Model identity management for distilled LLMs
  • System prompt modification based on model identification
  • Extension capability to surgically modify system prompts per turn

Install

Install the package from npm:

{
  "source": "npm:@jocax/model-identity"
}

Usage

This package can be installed in any Pi installation to provide distilled LLM identification and system prompt modifications.

The package provides a pi extension that can be activated in configuration to:

  • Detect distilled models like "opus-distill" or "gemma"
  • Modify system prompts to properly identify these local models as not being Claude

Example Behavior

When a model with ID containing "opus-distill" or "gemma", the extension will append this to system prompts:

You are Gemma 4 31B (Claude Opus Distilled v2), a local model. You are NOT Claude. You are NOT made by Anthropic.

This ensures proper identification of local distilled models in the Pi ecosystem.

Implementation Details

The package implements a Pi extension that:

  1. Listens to before_agent_start events
  2. Inspects the model ID in context
  3. Modifies system prompts when distilled models are detected
  4. Prevents Claude identification confusion for local model variants

Run the demo

just demo model-identity       # herdr — the default
just demo-web model-identity   # browser

herdr is the default because the demo's second half needs pi's own /model selector, which only a terminal has. In herdr the kit sends each scenario's first prompt automatically; you send the then text yourself.

The session runs on ollama/gemma4:31b-cloud, which Ollama must serve. On a model the package does not recognise, the extension does nothing — the other half of the comparison.

Scenario "Ask it which model it is" — no tools, so the answer can only come from the system prompt.

Step Do this Watch
1 Send the first prompt The answer names the gemma model id (e.g. "I am Gemma (gemma4:31b-cloud)."). That answer is the only evidence of the label — the appended line is not recorded in the session transcript
2 Type /model, filter to deepseek and pick deepseek-v4.1-flash:cloud pi switches model and prints Model: deepseek-v4.1-flash:cloud
3 Send the then text No label this time: deepseek-v4.1-flash:cloud matches none of the package's patterns, and the model answers that it is Claude, made by Anthropic, with no model id given

Scenario "The label survives a tool call"

Step Do this Watch
1 Send the prompt ls runs, then the answer still names gemma4:31b-cloud as the model id it was told — the label is re-applied before every turn, not injected once at the start

What the model says about itself is the model's own behaviour. What this package guarantees is the line appended to the system prompt; the answer is evidence of it, not a transcript record.

Needs herdr 0.9.3 or newer and one reachable model provider — see demo-kit.

Development

Testing

npm test

Unit tests are included to validate model detection and system prompt modification behaviors.