Skip to content

Add Ornith 1.0 to model catalog (catalog entry, think-block routing, update_node prompt) #1465

Closed

Description

@malibio

Overview

Ornith 1.0 9B (DeepReinforce, June 2026, MIT) passed evaluation in #1464. This issue implements the three remaining production tasks to make it a first-class catalog model.

Background: What the Experiment Found

Architecture

Ornith uses the qwen35 arch in llama.cpp — a hybrid SSM/attention model (Gated Delta Net). 24 of 32 layers are recurrent SSM; 8 are full multi-head attention (every 4th block). This gives it a unique property: generation speed is flat across context lengths — 12.0 t/s at 1k tokens, 11.9 t/s at 8k tokens. Pure-attention models degrade significantly past 4k on 16 GB hardware.

Tool-call format (Format D)

Ornith's embedded Jinja chat template defines a distinct XML-like format, different from all three formats the parser previously handled:

<tool_call>
<function=search_nodes>
<parameter=query>
Rust programming
</parameter>
</function>
</tool_call>

This parser is already implemented. parse_tool_calls_xml() and parse_xml_tool_call_block() are live in packages/nlp-engine/src/chat/parser.rs. emit_oai_delta() in mod.rs intercepts content containing <tool_call> and routes it through the XML parser before the text splitter. Experiment validated 8/10 tool calls parsed correctly.

update_node miss (prompt engineering)

update_node failed both trials — the model asked for clarification instead of calling the tool. The system prompt for update_node provides placeholder node_id and content values; Ornith treats these as literally "fill in the blank" rather than examples. Fix: provide concrete dummy values in the example call.

Reasoning (<think> blocks)

Ornith produces <think>...</think> blocks in the token stream when enable_thinking: true. The thinking content contains correct multi-step planning (e.g., search_nodes → get_node × N → create_node, with correct sequencing rationale). Currently these tokens leak into the visible response. The production ChatEngine needs a <think>/</think> routing path analogous to the existing Gemma 4 ChannelSplitter to emit ChatChunk::Reasoning events.

Speed / memory

Metric Value
GGUF size 5.23 GiB (Q4_K_M)
Model load 8.3s (Metal kernel init on first load)
TTFT 274ms
Tokens/sec 19.6
t/s at 8k ctx 11.9 (stable — SSM architecture)
Min RAM 16 GB

Integration path

Ornith uses apply_chat_template_oaicompat with use_jinja: true — same path as Gemma 4 E4B. No new model-loading code is needed; it routes through the existing OAI-compat pipeline.

Acceptance Criteria

  • Catalog entry: Add ornith-9b-q4_k_m to the model catalog with ModelFamily::Qwen35 (or a new Ornith variant if behavior diverges). Set min_ram_gb: 16, correct GGUF filename (ornith-1.0-9b-Q4_K_M.gguf), HuggingFace source URL.
  • ModelFamily wiring: agent_types.rs and model_manager.rs recognize Ornith (via Qwen35 mapping or dedicated variant) and route to apply_chat_template_oaicompat with use_jinja: true.
  • update_node prompt fix: Update the update_node tool description / example in the system prompt so the model calls the tool directly rather than asking for confirmation. Validate 2/2 trials pass.
  • <think> routing path: Add <think>/</think> detection to ChatEngine (analogous to Gemma 4's ChannelSplitter) so thinking tokens emit as ChatChunk::Reasoning events rather than leaking into ChatChunk::Content. Gate behind a model-family flag or enable_thinking config.
  • Unit tests: Add tests for parse_tool_calls_xml covering: single call, multiple calls, missing </tool_call> close, missing </parameter>, empty parameter body.
  • Smoke test: Load Ornith 9B, send one tool-calling prompt, confirm ChatChunk::ToolCallStart + ChatChunk::ToolCallArgs are emitted (no plain-text leakage of <tool_call> XML).

Files to Touch

  • packages/nlp-engine/src/chat/parser.rs — add unit tests for parse_tool_calls_xml (parser already implemented)
  • packages/nlp-engine/src/chat/mod.rs — add <think>/</think> routing path in emit_oai_delta() or a new OrnithChannelSplitter
  • packages/agent/src/agent_types.rs — add Ornith variant or confirm Qwen35 covers it
  • packages/agent/src/model_manager.rs — catalog entry + routing
  • System prompt / tool descriptions — update_node example fix

Out of Scope

  • Ornith 35B MoE (48 GB tier) — separate issue
  • Replacing Gemma 4 E4B or Ministral 8B — keep all three; each serves a different profile
  • Automatic default model changes — Ornith should be user-selectable first

Activity

  1. malibio commented on Jul 1, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 140 test files passed, 3893 tests passed (39.14s)

  2. self-assigned this
    on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions