← Catalog

@jocax/model-identity

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

Extension

Install

Install with PiG

pig install npm:@jocax/model-identity

Install with Pi

pi install npm:@jocax/model-identity
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./dist/index.js"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.1 (README.md). PiG does not review it.

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.

StepDo thisWatch
1Send the first promptThe 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
2Type /model, filter to deepseek and pick deepseek-v4.1-flash:cloudpi switches model and prints Model: deepseek-v4.1-flash:cloud
3Send the then textNo 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"

StepDo thisWatch
1Send the promptls 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.