| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Pi package with custom extensions, themes, and configurations for the Pi Coding Agent
VTSTech • Website • Extensions • Themes • Install
A Pi package containing extensions, themes, and configuration for the Pi Coding Agent. These tools are built and optimized for running Pi on resource-constrained environments such as Google Colab (CPU-only, 12GB RAM) with Ollama serving small local models (0.3B-2B parameters), as well as with cloud providers like OpenRouter, Anthropic, Google, OpenAI, Groq, DeepSeek, and more.
Everything here is battle-tested on real hardware with real models - from small local Ollama models on budget machines to cloud providers via OpenRouter.
pi install git:github.com/VTSTech/pi-coding-agentPi clones the repo, auto-discovers the extensions/ and themes/ directories, and loads everything automatically. Restart Pi and you're done.
Update to the latest version:
pi updatePin to a specific tag:
pi install git:github.com/VTSTech/pi-coding-agent@v1.3.0Install only what you need. Each extension is published as a standalone npm package under the @vtstech scope. All shared code is bundled into each package, so there are no extra dependencies to install.
# Install individual extensions
pi install npm:@vtstech/pi-diag
pi install npm:@vtstech/pi-hex-edit
pi install npm:@vtstech/pi-model-test
pi install npm:@vtstech/pi-security
pi install npm:@vtstech/pi-soul
pi install npm:@vtstech/pi-status
pi install npm:@vtstech/pi-api
pi install npm:@vtstech/pi-ollama-sync
pi install npm:@vtstech/pi-openrouter-sync
pi install npm:@vtstech/pi-react-fallback
pi install npm:@vtstech/pi-long-term-memory
# Update installed packages
pi updateAvailable packages:
| Package | Description |
|---|---|
| @vtstech/pi-diag | System diagnostic suite |
| @vtstech/pi-model-test | Model benchmark - Ollama & cloud providers |
| @vtstech/pi-security | Command/path/SSRF protection |
| @vtstech/pi-soul | SoulSpec persona management |
| @vtstech/pi-status | System resource monitor & status bar |
| @vtstech/pi-api | API mode switcher |
| @vtstech/pi-ollama-sync | Ollama ↔ models.json sync |
| @vtstech/pi-openrouter-sync | OpenRouter → models.json sync |
| @vtstech/pi-react-fallback | ReAct fallback for non-native tool models |
| @vtstech/pi-long-term-memory | Persistent memory across sessions |
| @vtstech/pi-hex-edit | Hex stream-based edit replacement for reliable file editing |
| @vtstech/pi-workspace | Workspace management and state persistence |
git clone https://github.com/VTSTech/pi-coding-agent.git
cd pi-coding-agent
cp extensions/*.ts ~/.pi/agent/extensions/
cp themes/*.json ~/.pi/agent/themes/
pi -cThis repo is a standard Pi package. The package.json contains a pi manifest that tells Pi where to find resources:
{
"name": "@vtstech/pi-coding-agent-extensions",
"version": "1.3.8",
"keywords": ["pi-package"],
"pi": {
"extensions": ["./extensions"],
"themes": ["./themes"]
}
}Pi auto-discovers from conventional directories (extensions/, themes/, skills/, prompts/) even without the manifest. The manifest is included for explicit declaration.
All extensions support remote Ollama instances out of the box - no extra configuration needed. The Ollama URL is resolved automatically from models.json:
models.json ollama provider baseUrl → OLLAMA_HOST env var → http://localhost:11434
This means you can:
Model testing and diagnostics work with cloud providers out of the box. The extensions auto-detect the active provider and adapt their behavior:
Supported providers (built-in registry):
| Provider | API Mode | Base URL |
|---|---|---|
| OpenRouter | openai-completions | https://openrouter.ai/api/v1 |
| Anthropic | anthropic-messages | https://api.anthropic.com |
| gemini | https://generativelanguage.googleapis.com | |
| OpenAI | openai-completions | https://api.openai.com/v1 |
| Groq | openai-completions | https://api.groq.com |
| DeepSeek | openai-completions | https://api.deepseek.com |
| Mistral | openai-completions | https://api.mistral.ai |
| xAI | openai-completions | https://api.x.ai |
| Together | openai-completions | https://api.together.xyz |
| Fireworks | openai-completions | https://api.fireworks.ai/inference/v1 |
| Cohere | cohere-chat | https://api.cohere.com |
Provider detection uses a three-tier lookup: user-defined providers in models.json → built-in provider registry → unknown fallback.
Run a full system diagnostic of your Pi environment.
/diag # Run full system diagnostic /diag --help # Show help /diag --full-prompt # Show full untruncated system prompt
Checks:
Also registers a self_diagnostic tool so the AI agent can run diagnostics on command.
Test any model for reasoning, tool usage, and instruction following - works with Ollama and all cloud providers (OpenRouter, OpenAI, Anthropic, etc.).
/model-test # Test current Pi model
/model-test qwen3:0.6b # Test a specific Ollama model
/model-test --all # Test every Ollama modelThe extension runs the extended test flow with 20 reasoning puzzles, multi-step JSON instruction compliance, and chained tool call generation.
| Test | Method | Scoring |
|---|---|---|
| Reasoning | 20 puzzle tests (logic, math, spatial, commonsense, counter-intuitive, causal, comparative, analogical) | STRONG / MODERATE / WEAK / FAIL / ERROR |
| Instructions | Multi-step JSON schema compliance with automatic repair | STRONG / MODERATE / WEAK / FAIL |
| Tool Usage | Chained tool call generation | STRONG / MODERATE / WEAK / FAIL / ERROR |
Features:
Features:
Sample output (cloud provider):
[model-test-report]
⚡ Pi Model Benchmark v1.3.3
Written by VTSTech
GitHub: https://github.com/VTSTech
Website: www.vts-tech.org (http://www.vts-tech.org)
── MODEL: poolside/laguna-xs.2:free ────────────────────────
ℹ️ Provider: openrouter (builtin)
── REASONING TEST (EXTENDED) ───────────────────────────────
i️ Testing 20 reasoning puzzles...
i️ Waiting 10.0s to avoid rate limiting...
✅ ✅ snail_wall (logic): STRONG - expected "8", got "8" [(expected: 8, got: 8)]
✅ ✅ math_sequence (math): STRONG - expected "162", got "162" [(expected: 162, got: 162)]
✅ ✅ spatial_directions (spatial): STRONG - expected "south", got "180" [(expected: south)]
⚠️ ❌ commonsense (commonsense): WEAK - expected "the other side", got "?" [(expected: the other side)]
❌ ❌ code_simplify (code): FAIL - expected "15", got "2" [(expected: 15, got: 2)]
✅ ✅ bat_and_ball (counterint): STRONG - expected "5", got "5" [(expected: 5, got: 5)]
✅ ✅ scale_weight (counterint): STRONG - expected "400", got "400" [(expected: 400, got: 400)]
✅ ✅ syllogism (logic): STRONG - expected "warm-blooded", got "?" [(expected: warm-blooded)]
✅ ✅ if_then_chain (logic): STRONG - expected "grass grows", got "1" [(expected: grass grows)]
✅ ✅ cause_effect (causal): STRONG - expected "grows", got "?" [(expected: grows)]
✅ ✅ relative_quantities (comparative): STRONG - expected "15", got "15" [(expected: 15, got: 15)]
⚠️ ❌ analogy_1 (analogy): WEAK - expected "room", got "?" [(expected: room)]
✅ ✅ analogy_2 (analogy): STRONG - expected "boot", got "?" [(expected: boot)]
✅ ✅ physics_1 (commonsense): STRONG - expected "bowling ball", got "80" [(expected: bowling ball)]
⚠️ ❌ physics_2 (commonsense): WEAK - expected "hot", got "?" [(expected: hot)]
✅ ✅ objects_1 (commonsense): STRONG - expected "scissors", got "?" [(expected: scissors)]
✅ ✅ social_1 (commonsense): STRONG - expected "polite", got "?" [(expected: polite)]
✅ ✅ animals_1 (commonsense): STRONG - expected "water", got "?" [(expected: water)]
✅ ✅ gk_1 (commonsense): STRONG - expected "mars", got "?" [(expected: mars)]
✅ ✅ gk_2 (commonsense): STRONG - expected "366", got "366" [(expected: 366, got: 366)]
✅ Average score: STRONG
── INSTRUCTION FOLLOWING TEST (EXTENDED) ───────────────────
i️ Testing multi-step JSON schema compliance...
i️ Waiting 10.0s to avoid rate limiting...
i️ Time: 1.4s
✅ JSON output valid with correct values (STRONG)
i️ Output: {"name":"Poolside
Assistant","can_count":true,"sum":42,"language":"English","colors":["red","blue","green"],"timestamp":"2025-01-09T1
2:00:00Z"}
── TOOL USAGE TEST (EXTENDED) ──────────────────────────────
i️ Testing chained tool calls...
i️ Waiting 10.0s to avoid rate limiting...
i️ Time: 349ms
✅ Tool calls: get_weather (MODERATE)
i️ Response: I'll get the weather for Tokyo and calculate that multiplication for you.
── SUMMARY ─────────────────────────────────────────────────
✅ Reasoning: STRONG
✅ Instructions: STRONG
✅ Tool Usage: MODERATE
i️ Total time: 1.3m
i️ Score: 3/3 tests passed
i️ Detailed: Reasoning 16/20 tests passed, Instructions 1/1, Tool Usage 1/1
── RECOMMENDATION ──────────────────────────────────────────
❌ poolside/laguna-xs.2:free is WEAK - limited capabilities for agent use
Runtime switching of API modes, base URLs, thinking settings, and compat flags in models.json.
Supports all 10 Pi API modes: anthropic-messages · openai-completions · openai-responses · azure-openai-responses · openai-codex-responses · mistral-conversations · google-generative-ai · google-gemini-cli · google-vertex · bedrock-converse-stream
/api # Show current provider config (mode, URL, compat flags)
/api mode <mode> # Switch API mode (partial match supported)
/api url <url> # Switch base URL
/api think on|off|auto # Toggle thinking for all models in provider
/api compat <key> # View compat flags
/api compat <key> <val> # Set compat flag
/api modes # List all 10 supported API modes
/api providers # List all configured providers
/api reload # Hint to run /reloadFeatures:
Command, path, and network security layer for Pi's tool execution with a configurable security mode.
Automatically loaded - protects against:
/security mode basic # Relaxed mode - CRITICAL commands blocked, localhost URLs allowed
/security mode max # Full lockdown - all 66 commands blocked, strict SSRF
/security mode off # Disable all security checksDefault mode: max - if security.json doesn't exist, the extension starts in max mode and creates it on first use. The current mode is displayed in the status bar (SEC:BASIC, SEC:MAX, or SEC:OFF).
Load and manage AI agent personas defined in SoulSpec format with progressive disclosure support and enhanced partial matching.
Automatically loaded - provides tools and commands for managing AI personas:
/souls # List all available souls
/soul nova-helper # Use the Nova Helper persona (exact match)
/soul dev # Load any soul containing 'dev' (partial matching)
/soul /dev/ig # Load any soul with 'dev' (case-insensitive regex)
/load_soul {"soul_name":"robot-assistant"} # Load robot assistant persona
/soul_info robot-assistant # Get detailed information about a soul
/soul --help # Show enhanced help with partial matching examplesPartial matching features:
Soul locations - The extension searches for souls in multiple directories:
Sample souls included:
Text-based tool calling bridge for models without native function calling support.
Automatically loaded - no commands needed. When a model lacks native tool calling:
Persistent memory across sessions with automatic injection, AI-driven creation, and enhanced statistics.
/memory add <text> - Add memory (with optional tags)
/memory delete <id|content> - Delete memory by ID or content
/memory replace <id> <new-content> [comma-separated-tags] - Replace memory content by ID
/memory list - List all memories
/memory clear - Clear memories (preserves metadata)
/memory clear-meta - Reset metadata
/memory meta - Show metadata
/memory backups - List available memory backups
/memory stats - Show comprehensive memory statistics
/memory-gate - Toggle memory creation gate
/memory --help - Show helpDelete Operations:
Replace Operations:
The /memory stats command provides detailed metrics:
Features:
Memory Injection Hooks:
Storage: .pi/agent/long-term-memory.json
A robust hex stream-based edit replacement that provides reliable, byte-level file editing with validation and transparency.
/hex-edit <file> <old-text> <new-text> # Edit file using byte-level validation
/hex-edit-show <file> # Show file with line numbers and hex preview
/hex-edit-validate <file> <text> # Validate that text exists in file
/hex-edit-diff <file1> <file2> # Show byte-level diff between filesFeatures:
Why Hex Edit? The built-in edit tool uses text-based matching which can fail due to:
Hex Edit solves this by:
When the built-in edit tool fails, hex-edit automatically intercepts and retries the operation with byte-level precision. No manual intervention needed!
Example:
/hex-edit src/index.ts "const old = 1" "const newVar = 2"
/hex-edit-validate src/index.ts "some text"
/hex-edit-show src/index.ts
/hex-edit-diff file1.ts file2.tsAuto-populate models.json with all available Ollama models - works with local and remote instances.
/ollama-sync # Sync from models.json URL (or localhost)
/ollama-sync https://your-tunnel-url # Sync from a specific remote URLAdd OpenRouter models to models.json from URLs or bare model IDs.
/or-sync <url-or-id> [url-or-id ...] # Alias
/openrouter-sync <url-or-id> [url-or-id ...]Manage, archive, and restore workspaces with session state.
/workspace — Show workspace management help
/workspace save <name> — Save current workspace state
/workspace load <name> — Load a saved workspace
/workspace list — List all saved workspaces
/workspace delete <name> — Delete a saved workspace
/workspace current — Show current workspace stateFeatures:
Adds composable named status items to the framework footer using ctx.ui.setStatus(). Each metric gets its own slot so it coexists cleanly with other extensions' status items.
CPU/RAM/Swap are only shown when using a local Ollama provider (not for cloud/remote). For cloud providers, system metrics are omitted. Model name, session tokens, and context usage are shown by the framework - not duplicated here. All labels use dimmed coloring; all values use green highlighting.
Status slots (updated every 5s, 1s for active tool):
All slots are cleared on session shutdown. Metrics that the framework already provides (model name, session tokens, context usage, thinking level) are intentionally omitted to avoid duplication.
A Matrix movie-inspired theme with neon green on pure black. Designed for terminal aesthetics and extended coding sessions.
/theme matrix
Color palette:
| Token | Color | Usage |
|---|---|---|
| green | #39ff14 | Primary text - neon green |
| brightGreen | #7fff00 | Accents, headings, inline code, highlights |
| phosphor | #66ff33 | Links, tool titles, code block text, secondary text |
| glowGreen | #00ff41 | Thinking text, quotes |
| fadeGreen | #00cc33 | Muted text, borders |
| hotGreen | #b2ff59 | Numbers, emphasis |
| yellow | #eeff00 | Status bar active tool timer |
| Background | #000000 | Pure black base |
# 1. Install the package
pi install git:github.com/VTSTech/pi-coding-agent
# 2. Restart Pi
pi -c
# 3. Sync your Ollama models into Pi (or use a cloud provider)
/ollama-sync # Local Ollama
/ollama-sync https://your-tunnel-url # Remote Ollama (e.g., Cloudflare Tunnel)
# 4. Reload Pi to pick up model changes
/reload
# 5. Run diagnostics to verify everything
/diag
# 6. Benchmark your models
/model-test --all
# 7. (Optional) Use long-term memory for persistent sessions
/memory list # View saved memories
/memory add "Remember to use TypeScript" # Add a memoryIf Ollama is running on a different machine, expose it via a tunnel and point Pi at it:
# On the Ollama machine - create a tunnel (example with cloudflared)
cloudflared tunnel --url http://localhost:11434
# In Pi - sync models from the tunnel URL
/ollama-sync https://your-tunnel-url.trycloudflare.comThe URL gets saved to models.json and all extensions use it automatically. No need to set OLLAMA_HOST or pass the URL again.
Pi handles cloud providers natively - just set your API key in the environment and select a model:
export OPENROUTER_API_KEY="sk-or-..."
# In Pi - select a cloud model
/model openrouter/openai/gpt-oss-120b:free
# Test it
/model-test{
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434/v1",
"api": "openai-completions",
"apiKey": "ollama",
"compat": {
"supportsDeveloperRole": false,
"supportsReasoningEffort": false
},
"models": []
}
}
}Use /ollama-sync to auto-populate the models array and set the correct baseUrl from your Ollama instance.
Optimized for CPU-only environments with limited RAM:
{
"defaultProvider": "ollama",
"defaultModel": "granite4:350m",
"defaultThinkingLevel": "off",
"theme": "matrix",
"compaction": {
"enabled": true,
"reserveTokens": 2048,
"keepRecentTokens": 8000
}
}Pi supports multiple API backends via the api field in models.json. For Ollama, use openai-completions which maps to Ollama's native /v1/chat/completions endpoint. Other available modes:
| API Mode | Use Case |
|---|---|
| openai-completions | Ollama, OpenAI-compatible /v1/chat/completions |
| openai-responses | OpenAI Responses API (/v1/responses) |
| anthropic-messages | Anthropic native API |
| google-generative-ai | Gemini API |
| google-vertex | Google Vertex AI |
| mistral-conversations | Mistral API |
| bedrock-converse-stream | Amazon Bedrock |
See Pi's AI package docs for the full list.
These extensions are optimized for running Pi on Google Colab with CPU-only and 12GB RAM. Here's the recommended Ollama launch configuration:
import subprocess, os
# Install Ollama
subprocess.run(["curl", "-fsSL", "https://ollama.com/install.sh"], check=True)
# Environment tuning for CPU-only 12GB
os.environ["OLLAMA_HOST"] = "0.0.0.0:11434"
os.environ["CONTEXT_LENGTH"] = "4096" # Reduce from 262k default
os.environ["MAX_LOADED_MODELS"] = "1" # Only one model in memory
os.environ["KEEP_ALIVE"] = "2m" # Unload after 2min idle
os.environ["KV_CACHE_TYPE"] = "f16" # Use f16 for KV cache
os.environ["OLLAMA_MODELS"] = "/tmp/ollama" # Store in tmpfs (RAM disk)
os.environ["BATCH_SIZE"] = "512" # Smaller batches for CPU
os.environ["NO_CUDA"] = "1" # Force CPU mode
# Start Ollama
subprocess.Popen(["ollama", "serve"])| Model | Params | Size | Reasoning | Tools | Best For |
|---|---|---|---|---|---|
| granite4:350m | 352M | 676 MB | ❌ | ✅ | Fast tasks, tool calling |
| qwen3:0.6b | 752M | 498 MB | ❌ | ✅ | Small footprint, native tools |
| qwen3.5:0.8b | ~800M | 1.0 GB | ❌ | ✅ | Daily driver |
| qwen2.5-coder:1.5b | 1.5B | 940 MB | ❌ | ✅ | Code tasks |
| llama3.2:1b | 1.2B | 1.2 GB | ❌ | ✅ | General use |
| qwen3.5:2b | 2.3B | 2.7 GB | ✅ | ✅ | Best quality (fits 12GB) |
See TESTS.md for full benchmark results across all tested Ollama and cloud provider models.
pi-coding-agent/ ├── extensions/ │ ├── api.ts # API mode switcher - modes, URLs, thinking, compat flags │ ├── diag.ts # System diagnostic suite │ ├── model-test.ts # Model benchmark - Ollama & cloud providers │ ├── ollama-sync.ts # Ollama ↔ models.json sync │ ├── openrouter-sync.ts # OpenRouter → models.json sync │ ├── react-fallback.ts # ReAct fallback for non-native tool models │ ├── security.ts # Command/path/SSRF protection │ ├── soul.ts # SoulSpec persona management │ ├── status.ts # System resource monitor & status bar │ └── workspace.ts # Workspace management & state persistence ├── shared/ │ ├── debug.ts # Conditional debug logging │ ├── format.ts # Shared formatting utilities │ ├── model-test-utils.ts # Shared test utilities, config, history │ ├── ollama.ts # Ollama API helpers, provider detection, mutex, retry │ ├── react-parser.ts # Multi-dialect ReAct text parser │ ├── security.ts # Security validation, SSRF, DNS rebinding, audit log │ └── types.ts # TypeScript types & error classes ├── themes/ │ └── matrix.json # Matrix movie theme ├── individual-packages/ # Source for individual npm packages │ ├── pi-shared/ # Shared utilities (bundled into extensions) │ ├── pi-api/ # API mode switcher │ ├── pi-diag/ # System diagnostics │ ├── pi-model-test/ # Model benchmarking │ ├── pi-ollama-sync/ # Ollama synchronization │ ├── pi-openrouter-sync/ # OpenRouter synchronization │ ├── pi-react-fallback/ # ReAct fallback │ ├── pi-security/ # Security extensions │ ├── pi-soul/ # SoulSpec personas │ ├── pi-status/ # System monitoring │ └── pi-workspace/ # Workspace management ├── dist/ # Built npm packages (published to npmjs.com) ├── scripts/ │ ├── build-tgz.sh # Build all individual .tgz packages │ ├── bump-version.sh # Linux/macOS version bump script │ └── bump-version.ps1 # Windows PowerShell version bump script ├── CHANGELOG.md # Version history ├── TESTS.md # Model benchmark results ├── VERSION # Single source of truth for version ├── package.json # Pi package manifest ├── README.md └── LICENSE
Written by VTSTech
🌐 www.vts-tech.org • 🐙 GitHub • 📧 veritas@vts-tech.org
Optimizing AI agent development for resource-constrained environments.
| Back | FazBrowse Home | New Git URL |