56 lines
4.2 KiB
Markdown
56 lines
4.2 KiB
Markdown
# Perry history
|
|
|
|
This file records why Perry changed, not every mechanical code edit.
|
|
|
|
## Conversation history became the session
|
|
|
|
The original problem was practical: build a chat client around Ollama whose sessions could be persisted, branched, and have information injected into them.
|
|
|
|
No extra session architecture was necessary. The provider already accepted conversation history in a JSON-friendly shape. Persisting that history persisted the session. Copying the history created a branch. Inserting or composing portions of history altered what the model knew.
|
|
|
|
Reusable conversation subsets became "Legos." Ordered collections of them became "Lego Towers." The useful technique emerged from ordinary chat history rather than from a new agent/session framework.
|
|
|
|
That remains a foundational Perry decision.
|
|
|
|
## Chat2 became reusable infrastructure
|
|
|
|
Several application pipelines independently needed the same mechanics around local LLM calls: prepared conversational agents, streaming reasoning and content, transport retries, incomplete-response continuation, and persistent conversation history.
|
|
|
|
The repeated implementation became Chat2 and was later extracted as Perry so applications could own domain behavior while sharing the mechanics of operating an LLM-backed conversational agent.
|
|
|
|
## LM Studio became the surviving provider
|
|
|
|
The older lineage supported Ollama, but the code available when Perry was extracted contained only the active LM Studio Responses API implementation. Perry documented that fact instead of reconstructing an Ollama provider from memory.
|
|
|
|
This is intentional simplicity: provider-neutral scope does not require speculative provider implementations.
|
|
|
|
## Repetition self-destruct
|
|
|
|
Real LM Studio/model runs demonstrated a catastrophic failure mode where a generation could fall into an exact repeating token orbit indefinitely. A deliberately conservative detector was added to the LM Studio streaming implementation.
|
|
|
|
It checks the reasoning and final-content channels independently and aborts only after an exact token sequence has repeated seven complete times. The normal retry layer can then restart the response without adding the pathological partial response to conversation history.
|
|
|
|
The behavior is intentionally provider-specific until multiple provider implementations demonstrate that a shared abstraction is useful.
|
|
|
|
## Perry 0.2: consolidate lessons from the family
|
|
|
|
The application family continued evolving after Perry was extracted. A Coptic guide pipeline learned that LM Studio model warmup failures must be fatal: continuing after a requested model cannot load allows expensive downstream work to run under false assumptions.
|
|
|
|
At the same time, Perry itself had acquired repetition protection that the copied Chat2 implementations did not contain. The divergence demonstrated why LLM transaction mechanics should have one home.
|
|
|
|
Perry 0.2 consolidates those lessons and clarifies the boundary:
|
|
|
|
- Perry is provider-neutral, not "local-model" infrastructure.
|
|
- Perry is constructed directly from explicit `provider` and `model` settings and has no dependency on Optimus.
|
|
- Instances are lightweight and may be created freely.
|
|
- `client` was deliberately replaced by `provider`; no compatibility alias was retained while the family is being revisited together.
|
|
- LM Studio warmup now fails fast when the requested model cannot be made available.
|
|
- Availability is checked before each request attempt rather than cached for the life of a Perry instance.
|
|
- The exact model requested by the consumer is the model Perry requests. Application aliases belong upstream.
|
|
- If LM Studio explicitly identifies a different response model, the response is rejected rather than treated as equivalent.
|
|
- The unused reasoning-effort configuration lever was removed. Reasoning streaming remains supported.
|
|
- Perry no longer writes reasoning, content, retries, continuations, or other user-facing messages to the console. Consumers own their UI and logging.
|
|
- Existing continuation, retry, provider diagnostics, Lego formation, and LM Studio repetition behavior were retained.
|
|
|
|
The goal was consolidation, not redesign. Downstream applications can keep their current orchestration shape and wrap Perry locally if that minimizes change.
|