MusePi

Embedded Local Tiny-Model Experiments

English 中文

This document summarizes the experiments behind the optional local tiny-model paths for session-title generation (providers.tinyModel), Mnemopi memory extraction/consolidation (providers.memoryModel), and the auto thinking-level difficulty classifier (providers.autoThinkingModel, which reuses the memory-model registry). It is a factual engineering record for maintainers: what we measured, which recipes won, and which models we shipped. All three settings default to online, so existing users incur no downloads or on-device inference cost unless they opt in.

Runtime / environment findings

Task 1: Session title generation (providers.tinyModel)

Task: turn the first user message into a 3–6 word title. Tiny models (sub-1B) suffice.

Winning recipe:

What we learned:

Leaderboard (tag trick, CPU, warm):

Model Verdict
LFM2-350M Best speed/quality balance (~212MB)
Qwen3-0.6B Most robust
gemma-3-270m Smallest viable
Qwen2.5-0.5B Acceptable
SmolLM2-135M Too small
flan-t5-small Rejected — just echoes the input

Shipped local options: lfm2-350m, qwen3-0.6b, gemma-270m, qwen2.5-0.5b, lfm2-700m. Default: online (@smol).

Task 2: Mnemopi memory (providers.memoryModel)

Mnemopi runs two small-LLM tasks:

  1. Extraction — pull durable, structured items from a single message.
  2. Consolidation — summarize a list of memories into 1–3 faithful sentences.

These need bigger models than titles: 1B–1.7B. We tested LFM2-1.2B, Qwen2.5-1.5B, Qwen3-1.7B, and gemma-3-1b (q4, CPU) via four parallel agents each running 27–31 experiments.

Extraction findings

The stock 5-category JSON prompt fails on small models in two ways:

  1. The all-empty example {"facts":[],...} gets copied verbatim → 0 facts extracted.
  2. Capable models emit JSON objects inside arrays, which Mnemopi’s String(item) coerces into the literal string [object Object].

The robust fix is a one-item-per-line output format (consumed by Mnemopi’s parser line-fallback) or a flat JSON array of strings. Every model also over-extracts pure small talk; an explicit chit-chat → NONE example is the best mitigation.

Technique polarity flips vs titles

Per-model verdicts (head-to-head, 16-fixture set)

Recommendation

Extraction favors precision (do not pollute long-term memory) → Qwen3-1.7B is the best single pick (its consolidation is good enough). If running a second model for consolidation, gemma-3-1b wins that task.

Shipped local options: llama3.2:3b, qwen3-1.7b (recommended), gemma-3-1b, qwen2.5-1.5b, lfm2-1.2b. Default: online (the configured smol model).

Known Mnemopi parser bugs (surfaced by these experiments)

Integration notes