Commit 3a7f827
feat(ai): zero-config local AI terminal access -- mios-ai + aichat default
Wire the local Ollama endpoint into the operator's bare shell so
talking to the AI is one command after first boot:
* /usr/bin/mios-ai -- canonical entrypoint that resolves
MIOS_AI_ENDPOINT + MIOS_AI_MODEL at call
time (from /etc/mios/install.env / env)
and routes through aichat. Single-shot
mode (mios-ai "<prompt>") or REPL.
-e ollama|localai switches endpoints;
-m <model> overrides the model. Probes
/v1/models for reachability and bails
with a useful "is ollama up?" message on
timeout. Falls back to a curl+jq pipeline
when aichat isn't installed.
* /etc/aichat/config.yaml -- system-wide aichat default. Ships an
ollama OpenAI-compat client at
localhost:11434/v1 plus a localai client
at :8080 as a secondary. Stream + emacs
keys + save_session enabled. Per-user
~/.config/aichat/config.yaml still
overrides this when present.
* automation/36-tools.sh -- adds mios-ai to the TOOLS array so the
executable bit is fixed during the build's
system_files overlay pass.
The infrastructure was already in place:
* usr/share/containers/systemd/ollama.container -- Quadlet running
docker.io/ollama/ollama:latest, publishing 0.0.0.0:11434
* usr/libexec/mios/ollama-firstboot.sh -- pulls MIOS_AI_MODEL
+ MIOS_AI_EMBED_MODEL into /var/lib/ollama/models on first boot
* usr/lib/systemd/system/mios-ollama-firstboot.service -- timer
* usr/lib/systemd/system-preset/90-mios.preset -- enables both
ollama.service (Quadlet-generated) and mios-ollama-firstboot.service
What was missing was the operator-facing shell hook: by the time
the first interactive shell renders the dashboard, ollama is running
and the configured model is present, but `aichat` would still fall
back to its OpenAI defaults without a config file. mios-ai + the
shipped aichat config close that gap.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6c73598 commit 3a7f827
2 files changed
Lines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
0 commit comments