Externalize prompts and add llama startup warmup - #7
Merged
Merged
Conversation
Prompt refactor
- Move all four step prompts (gate, extract, goals, respond) and their
few-shot examples out of Prompt module source into priv/prompts/:
priv/prompts/<step>.txt — system instruction prose
priv/prompts/<step>_shots.chatml — raw ChatML few-shot turns
- Load both files at compile time via @external_resource + File.read!/1
so mix compile picks up edits without touching .ex source.
- Expand shot coverage across all four steps:
- gate: 10 shots covering rhetorical assertions, back-references,
imperatives-as-queries, social/chitchat disambiguation
- extract: 11 patterns including graph/edge notation and transitivity
- goals: 7 patterns covering polar/wh/attribute, superlatives,
multi-condition decomposition, set-difference
- respond: 17 evidence shapes (learned fact/rule/constraint/enum,
true/false/bound queries, unanswered, contradiction, mixed, empty)
Llama server
- Add --mlock to the llama-server argv to pin model pages in RAM after
the first warm-up inference pages them in (requires ulimit -l).
- Send :warmup to self once the server transitions to :ready; a Task
fires a 1-token completion so the page-fault storm is paid at startup
rather than on the first user turn. Failure is non-fatal (logged as
warning).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompt refactor
priv/prompts/.txt — system instruction prose
priv/prompts/_shots.chatml — raw ChatML few-shot turns
so mix compile picks up edits without touching .ex source.
imperatives-as-queries, social/chitchat disambiguation
multi-condition decomposition, set-difference
true/false/bound queries, unanswered, contradiction, mixed, empty)
Llama server