> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Local-first daily brief

> T1 starter · zero keys, zero cloud: fetch real data, brief it with a local Ollama model, keep a tamper-evident trace.

> **T1 starter · local-first**: the whole loop on your machine — a real
> HTTP fetch, a local model, a verifiable trace. No API key exists in
> this tutorial, so there is nothing to leak and nothing to meter.

## The job

A morning brief from a live source, every day, the same way. One file
captures it; your laptop runs it; the trace proves what happened.

## Prerequisites

* `nika` installed: `brew install supernovae-st/tap/nika` ([other paths](https://docs.nika.sh/getting-started/installation.md))
* [Ollama](https://ollama.com) running with a small model:
  `ollama pull qwen3.5:4b` (any local model works — swap the `model:` line)

## The file

Save as `daily-brief.nika`:

```yaml theme={"system"}
nika: daily-brief
model: ollama/qwen3.5:4b

permits:
  exec: false                          # nothing shells out
  net:
    http: ["hn.algolia.com"]           # the one host this file reaches
  tools: ["nika:fetch"]

tasks:
  fetch:
    invoke:
      tool: "nika:fetch"
      args: { url: "https://hn.algolia.com/api/v1/search?tags=front_page" }

  brief:
    with:
      stories: ${{ tasks.fetch.output }}
    infer:
      max_tokens: 300
      prompt: |
        Five bullet points, most signal first: ${{ with.stories }}

outputs:
  brief: ${{ tasks.brief.output }}
```

Swap the URL for any JSON source — an RSS-to-JSON bridge, your issue
tracker's API, a status page.

## Check, then run

```sh theme={"system"}
nika check daily-brief.nika
```

The static audit passes before a single token is spent — plan, types,
tools, args, secret flows. One honest wrinkle to read, not fear:

```text theme={"system"}
⚠  COST     bounded portion $0.0000 no total ceiling · 1 unpriced task · prompts, exec + mcp unpriced · prices 2026-10-12
  brief  ollama/qwen3.5:4b  UNBOUNDED — no catalog price (local model; spend not metered)
```

A local model has no list rate, so the engine says **unbounded** instead
of pretending `$0.00` is a promise. Local work is never blocked and never
metered — the flag exists so a *paid* uncataloged model can't hide behind
a fake zero ([cost honesty](https://docs.nika.sh/guides/cost-honesty.md)).

Then:

```sh theme={"system"}
nika run daily-brief.nika
```

Rehearse the shape first with `--model mock/echo`: a rehearsal replaces
the model, not the tools, so the fetch still reaches the network. On
v0.123.0 the card reads:

```text theme={"system"}
✔  fetch  invoke · nika:fetch · untrusted input from fetch  789ms
✔  brief  infer · mock/echo · untrusted input from fetch  2ms
2 tasks · 2 waves · 0 retries · 299 tok
── 2/2 done · unpriced (1 call) · elapsed 0.8s ─────────────────
  trace: .nika/traces/2026-10-24T14-50-51Z-e96b.ndjson · 10 events · chain 7d54a6c6…
```

Then run it without `--model`: the `brief` line names
`ollama/qwen3.5:4b`, the note is the model's five bullets, and the total
still reads `unpriced`. A local model is never metered as `$0.00`.

## The receipt

```sh theme={"system"}
nika trace verify   # the latest run in this folder; or pass the path the run printed
```

```text theme={"system"}
OK — 10 events · chain intact · head 7d54a6c683e499ee40b4113060bba40a509aea1f2365b7b59f71377035820157
  internally consistent (tamper-evident, not tamper-proof) — compare the head
  against the one the run printed to close the loop
UNSEALED — no run_sealed frame: the run was not signed …
```

The trace is a hash chain: edit any event after the fact and `verify`
exits non-zero. Your brief comes with proof of what ran, in what order,
against which inputs, even offline. `UNSEALED` means no run-signing key
signed this record: mint one once per machine with
`NIKA_KEYCHAIN=off nika key init`, and later runs verify as `SEALED`
([Seal your runs](https://docs.nika.sh/getting-started/installation.md#seal-your-runs)).

## Make it daily

Cron it, or wire [the GitHub Action](https://docs.nika.sh/integrations/github-actions.md) if the
file lives in a repo — every edit to the workflow gets a static check
before it lands. When you want the run itself in CI, that stays a
deliberate step in your own job, with your own budget flags.

## Where to go next

* Read the `permits:` block as the contract: absent is zero authority,
  present is default-deny. `nika check --infer-permits` writes the
  tightest one for the next file you author
  ([security](https://docs.nika.sh/concepts/security.md)).
* Persist the brief: a third task with `nika:write` and a
  `content:` binding ([starters](https://docs.nika.sh/examples/standup-digest.md) show the shape).
* Mix providers: keep `fetch` local, point `brief` at a cloud model with
  `--max-cost-usd` — the budget gate prices the file's own model before
  anything starts ([cost honesty](https://docs.nika.sh/guides/cost-honesty.md)).
* From an app: `npm install @supernovae-st/nika@0.124.4`, then `run()` /
  `run.result()` on this file — [SDK quickstart](https://docs.nika.sh/sdk/start/quickstart.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.