Skip to content

Loading the guide…

    Local models

    Updated

    Most rules need no model. Rules with check: llm ask a model on your machine, through Ollama. This page covers how models are chosen, what is sent to them, and what happens when there is no answer.

    What works without Ollama

    Everything except llm rules, rules draft and rules lint --deep. That includes all pattern, structure and command rules, the git hooks, the agent hook, the watcher, the hook guard, the inventory, the briefing, plan reminders and keep-going.

    Without Ollama, an llm rule is skipped with a warning. It never blocks anything. Many example sets have no llm rules at all (Rules).

    How a model check runs

    1. A commit (or other trigger) queues the check. Queuing is instant, so no hook waits for a model.
    2. The watcher asks the model in the background. Without a running watcher, checks stay in the queue.
    3. PASS resolves the rule's open findings for that change. FAIL records a finding.
    4. You can see the result in houndwatch findings. The agent gets results for its session or a file at a later hook call. At commit, a warn about a staged change appears only if that same change is committed again. An open model block finding refuses the next commit.

    A warn rule whose prompt uses {spec} doesn't run when there is no spec. A block rule still asks the model, and its prompt says no spec was found. Otherwise, a project's spec_dir could turn off your rule. If a change was already judged with its spec, a PASS without one doesn't clear its block.

    A commit that has already been made isn't undone. In the test for this guide, a block model rule let its commit through, recorded its finding within a minute, and refused the next commit.

    If several checks for the same rule and change are queued, only the newest is asked.

    Tiers and routing

    • Tier 1: the smallest chat model you have with at least 1B parameters.
    • Tier 2: the largest chat model you have, preferring one with coder in its name.

    Embedding, OCR, llava and vision models are never picked. Set tier1_model and tier2_model to choose your own.

    Each rule's tier is 1, 2 or auto. With auto, the rule and the change are scored for complexity. A score at or above routing_threshold (default 5.0) goes to tier 2, and anything lower goes to tier 1.

    Tier 1 never blocks alone. In the first trial, the small model blocked four commits that only added tests. Now a tier 1 FAIL on a block rule is asked again at tier 2:

    • if tier 2 also says FAIL, it blocks;
    • if tier 2 says PASS, the finding is cleared;
    • if tier 2 can't answer, it is recorded as an unconfirmed warn.

    A rule with skip_unless: removes_lines passes without asking a model when the change removes no lines in the rule's applies_to.paths. The "tests not weakened" rules use this, so adding tests costs no model call.

    If you think a model's block is wrong, appeal it (Day-to-day use).

    Context size and keep-alive

    Every request sends a context size, so a small model isn't loaded with the Ollama app's possibly huge default. In the first trial, a 128k app setting loaded a 3B model at 18 GB and made checks time out (Install HoundWatch™).

    KeyDefaultMeaning
    llm_context8192context size for every check (Ollama's num_ctx)
    llm_keep_alive"10m"how long Ollama keeps the model loaded after a request
    llm_draft_context32768context size for houndwatch rules draft, so a long document isn't cut off

    ollama ps shows which models are loaded, how big they are and their context size.

    When Ollama doesn't answer

    If Ollama times out (after 60 seconds), can't be reached or has no usable model, HoundWatch™ retries after 30 seconds and again after 2 minutes. Then it records a warning:

    text
    #1 [warn] llm-check-skipped: llm check diff-matches-message skipped for commit:staged:886e3665303c6cb3 after 3 tries: Ollama at http://localhost:9 is unreachable or has no models installed

    It never blocks. The check isn't asked again for the same change by itself, but a later answer for it resolves the warning. The watcher's log, .houndwatch/watcher.log, shows each retry.

    Keeping your code on your machine

    HoundWatch refuses an ollama_url that isn't on this machine (localhost, 127.x or ::1):

    text
    houndwatch: /Users/you/.houndwatch/config.yaml: ollama_url 'http://192.168.1.20:11434' is not on this machine; code and specs would leave it. Use a localhost URL, or set allow_remote_ollama: true in the same file to accept that

    To use Ollama on another machine, set both keys in ~/.houndwatch/config.yaml:

    yaml
    ollama_url: http://192.168.1.20:11434
    allow_remote_ollama: true

    Then prompts, with your diffs and specs in them, go to that machine. A project config can't set either key.