Copy of the legacy ~/.pi/agent/docs tree rebuilt as the command-center knowledge base: concept files promoted to path identity, index listings stripped of frontmatter, all wikilinks/relative links resolved, every checkable claim verified against the live fleet (Dankserver = Ryzen 7 7700X + RTX 3090; Strix Halo is Dankclaw), unverifiable claims tagged. kb-lint exits 0.
149 lines
6.4 KiB
Markdown
149 lines
6.4 KiB
Markdown
---
|
|
type: reference
|
|
title: Pi Models Configuration
|
|
description: Complete reference for models.json — provider definitions, model specs, and API endpoints for the Frank Program.
|
|
tags:
|
|
- pi
|
|
- models
|
|
- providers
|
|
- llamacpp
|
|
- unverified
|
|
timestamp: 2026-08-28
|
|
---
|
|
|
|
# Pi Models Configuration (`models.json`)
|
|
|
|
`models.json` defines the LLM providers pi connects to. Each provider specifies a base URL, API type, authentication, and available models.
|
|
|
|
**Location:** `/home/dank/.pi/agent/models.json`
|
|
|
|
---
|
|
|
|
## Providers
|
|
|
|
Current providers in `models.json` (verified 2026-08-27, after the
|
|
2026-08-18 service swap):
|
|
|
|
### llamacpp (dankserver)
|
|
|
|
| Property | Value |
|
|
|----------|-------|
|
|
| **Base URL** | `http://192.168.0.235:7770/v1` |
|
|
| **API** | `openai-completions` |
|
|
| **Auth** | None (EMPTY) |
|
|
| **Host** | [[dankserver|dankserver]] |
|
|
|
|
#### Models
|
|
|
|
| Model ID | Context Window | maxTokens | Reasoning | Input Types |
|
|
|----------|---------------|-----------|-----------|-------------|
|
|
| `frank-default-small` | 262,144 | 262,144 | Yes | Text, image |
|
|
|
|
The server is upstream llama.cpp (b10121) serving HauhauCS
|
|
Qwen3.6-35B-A3B-Uncensored-Aggressive Q6_K_P with 36 MoE experts on CPU,
|
|
ngram-mod spec, 4 slots of ~175K context. The server serves the loaded
|
|
model regardless of the requested model ID. Requests with any `model`
|
|
value succeed.
|
|
|
|
### llamacpp (dankclaw)
|
|
|
|
| Property | Value |
|
|
|----------|-------|
|
|
| **Base URL** | `http://192.168.0.143:7770/v1` |
|
|
| **API** | `openai-completions` |
|
|
| **Auth** | None (EMPTY) |
|
|
| **Host** | [[dankclaw|dankclaw]] |
|
|
|
|
> 2026-08-22: `frank-default-large` moved from `:52625` to `:7770` on
|
|
> Dankclaw (operator request: the primary inference server sits on the
|
|
> standard llama.cpp port). The OpenWebUI quadlet
|
|
> (`OPENAI_API_BASE_URL`) was re-pointed to `:7770` in the same change.
|
|
|
|
#### Models
|
|
|
|
| Model ID | Context Window | maxTokens | Reasoning | Input Types |
|
|
|----------|---------------|-----------|-----------|-------------|
|
|
| `frank-default-large` | 262,144 | 262,144 | Yes | Text, image |
|
|
|
|
The server is the ROCmFPX llama.cpp runtime serving
|
|
[kingjones777's Qwen3.8-Flash-Next Uncensored ROCmFP4 STRIX_LEAN GGUF](https://huggingface.co/kingjones777/Qwen3.8-Flash-Next-Uncensored-ROCmFP4-STRIX_LEAN-GGUF)
|
|
— a 177B-parameter, 56B-MoE model sharded into 3 Q4_0-ROCmFP4 GGUF files
|
|
(98.3 GB total) with a standalone BF16 vision embedding project (0.85 GB).
|
|
Speculative decoding uses `--spec-type ngram-mod` because the ROCmFPX quantization
|
|
drops the 4B MTP head. The model is loaded from
|
|
`/home/dank/models/kingjones-Qwen3.8-Flash-Next-Uncensored-ROCmFP4-STRIX_LEAN/`;
|
|
the original Q4_0-ROCmFP4-STRIX variant remains as a `.backup` directory.
|
|
Context is 262144 (native max), 1 slot. Concurrent requests queue on the
|
|
single slot; the server never preempts a running generation. It exposes
|
|
`reasoning_content` in deepseek reasoning format and supports
|
|
multimodal (vision) inference via the embedded mmproj.
|
|
|
|
2026-08-27: Upgraded from the original Qwen3.8-Flash-Next Q4_0-ROCmFP4-STRIX
|
|
GGUF to the Uncensored STRIX_LEAN variant with vision support and
|
|
ngram-mod speculative decoding.
|
|
|
|
### Thinking Levels
|
|
|
|
Pi's default thinking level is configured globally in `settings.json` as
|
|
`"defaultThinkingLevel": "medium"`. The model entries map Pi's `max` level to the llama.cpp-supported `xhigh`
|
|
wire value. Pi shows `max` in the thinking selector from the global settings,
|
|
but sends `reasoning_effort: "xhigh"` to both local llama.cpp endpoints.
|
|
`thinkingLevelMap` can translate a UI level without changing the global default.
|
|
Verified 2026-07-22:
|
|
`getSupportedThinkingLevels` returns `off,minimal,low,medium,high,xhigh`
|
|
and the live server accepts `reasoning_effort: "xhigh"` and returns
|
|
`reasoning_content` (verified 2026-08-21).
|
|
|
|
Mechanism (pi-ai `models.js` + `openai-completions.js`):
|
|
|
|
- `getSupportedThinkingLevels`: extended levels `xhigh`/`max` appear only
|
|
when `thinkingLevelMap` defines them (string = supported, `null` =
|
|
hidden, omitted = not supported).
|
|
- Default request path (no `compat.thinkingFormat`): sends
|
|
`reasoning_effort = thinkingLevelMap[level] ?? level` when
|
|
`supportsReasoningEffort` is true (default for this provider).
|
|
|
|
## Token Budgets (`maxTokens`)
|
|
|
|
Verified in the pi source, 2026-08-16 (`@earendil-works/pi-coding-agent` 0.84.1 + `pi-ai`):
|
|
|
|
- `maxTokens` is an optional model field in `models.json`. When omitted, pi defaults the model object to 16,384 (`provider-composer.js`).
|
|
- The value is metadata. It drives the model-picker "max out" display and length-error recovery (`isRecoverableLength`).
|
|
- Normal chat turns do not send `max_tokens`. The request builder sends the field only when a per-request option is set (`openai-completions.js buildParams`: `if (options?.maxTokens)`). The agent loop passes no such option.
|
|
- The only pi calls that send `max_tokens` are context compaction and branch summarization. They are deliberately budgeted.
|
|
|
|
## Model Selection Strategy
|
|
|
|
```mermaid
|
|
graph LR
|
|
A[User Request] --> B{Complexity?}
|
|
B -->|Large context / long docs| C[frank-default-large<br/>CIRU llama.cpp dankclaw :7770, 262K ctx]
|
|
B -->|Fast / interactive| D[frank-default-small<br/>llama.cpp dankserver :7770, 262K ctx]
|
|
|
|
The CIRU endpoint (dankclaw) serves the 177B 56B-MoE model with
|
|
262144 context, ngram-mod speculative decoding, 1 slot. Concurrent
|
|
requests queue on the single slot. The upstream
|
|
llama.cpp endpoint (dankserver) serves the 35B A3B MoE model with 36
|
|
experts on CPU and 262K context per slot.
|
|
## Live Defaults
|
|
|
|
`settings.json` picks the main session provider and model (verified 2026-08-19):
|
|
|
|
| Scope | Provider | Model |
|
|
|-------|----------|-------|
|
|
| Main session | `llamacpp (dankclaw)` | `frank-default-large` |
|
|
| Subagent default | `frank-default-small` (llamacpp dankserver) | ~262K ctx per slot, ngram-mod spec |
|
|
| Subagent overrides | scout, researcher | `frank-default-small` |
|
|
| Subagent overrides | planner, worker, reviewer, oracle, context-builder | `frank-default-large` (llamacpp dankclaw) |
|
|
|
|
The subagent model IDs (`frank-default-small`, `frank-default-large`) resolve against the new provider set in `models.json`. The current mappings are `max -> xhigh` for both local models; the global and subagent defaults remain `max`.
|
|
|
|
---
|
|
|
|
## See Also
|
|
|
|
- [[settings|settings]] — Main configuration file
|
|
- [[dankserver|dankserver]] — Primary llama.cpp server
|
|
- [[dankclaw|dankclaw]] — Secondary llama.cpp server
|
|
- [ornith-llama-cpp-setup](../tools/ornith-llama-cpp-setup/index.md) — Local Ornith model setup
|