672 Commits
Author SHA1 Message Date
goodman e046ad2c01 fix(ai): use 'ollama' placeholder apiKey for OpenAI client
Some OpenAI-compatible backends with keyless auth (such as Unsloth Studio) only accept standard dummy keys like 'ollama' and reject 'nomad' with 401. Ollama, LM Studio, and llama.cpp continue to work as before.
2026-12-03 14:29:30 -08:00
chriscrosstalkandClaude Opus 5.5 11dc9dd116 fix: replace dead Discord vanity invite with projectnomad.us/discord (#1655)
discord.com/invite/crosstalksolutions stopped resolving when the server lost
boost level 3. projectnomad.us/discord redirects to a permanent invite and can
be repointed without another code change.


Claude-Session: https://claude.ai/code/session_0198uVQXqx8zYx1iuDWzYAE9

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:02:32 +00:00
jakeaturner 8dcb8ea2f0 docs(release): finalize v1.35.2 release notes [skip ci] 2026-11-24 22:51:37 +00:00
jakeaturnerandClaude Opus 5.5 7fa2746005 docs: update release notes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:42:20 +00:00
jakeaturner ecaa8c93b0 fix(Collections): tighten ZIM matching logic when handling previous_ids 2026-11-17 22:27:51 -08:00
Chris SherwoodandClaude Opus 5.5 13048a89bc fix(collections): keep installs when openZIM renames a curated ZIM
A manifest entry can now list its former ids in previous_ids. When the catalog arrives, install rows under a former id move to the current id; boot reconcile maps old-name files to the current id; and the post-update cleanup may delete the resource's previous file even when it carries the former id. Without this, a rename made the existing file read as not installed, froze it out of updates, and left the old file on disk after a re-download.

Refs #1171.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:27:51 -08:00
jakeaturner e1a814a3c1 fix(apps): bump default project-nomad-translate version to 0.1.2 2026-11-17 22:18:36 +00:00
jakeaturner 2ef44ce482 fix(maps): close CORS traversal and error-page leaks
Normalize and decode the request path before matching map asset
prefixes so encoded ..%2F can no longer reach other public static
files with the CORS header. Drop Access-Control-Allow-Origin on
4xx/5xx responses so error pages, which include the app version and
assistant name, stay same-origin.
2026-11-17 22:18:36 +00:00
jakeaturner d1e17fa17b fix(downloads): migration to reset Wikipedia selections damaged by #1482
Installs damaged by #1482 still have the Wikipedia selection pointing at
another wikipedia_en_* corpus such as the Medicine tier ZIM. On those
installs, choosing "None" deletes Medicine, and the boot reconcile skips
Medicine's InstalledResource row, so its tier won't show as installed.

This one-off migration resets any selection whose filename (or pending
URL) isn't a Wikipedia selector option. It leaves the file on disk, so the
next reconcile restores the Medicine row. It reads the option list from the
cached wikipedia manifest and falls back to the current option filenames.
2026-11-17 22:18:35 +00:00
jakeaturner b8b6e8995e docs: update release notes 2026-11-17 22:18:34 +00:00
jakeaturner 0e4f0615fa fix(rag): fail a ZIM batch only when its resume point is past the end
The resume check failed any batch that picked up from its saved
position, found no articles, and still had startOffset below
articleCount. Our article count and libzim's articleCount do not
match. Older ZIMs count redirects in articleCount, and some ZIMs
come out the other way (#903). So a file whose article count is an
exact multiple of the batch size failed on its last, empty batch.
It retried 30 times and never got marked indexed.

An empty batch at a valid saved position is a normal end of file.
The real broken case is a saved position past the end of the entry
range, which means the file changed between batches. openZimBatchRange
now throws UnrecoverableError for that, and processAndEmbedFile lets
UnrecoverableError through instead of turning it into
{ success: false }, so BullMQ does not retry.

Replace the test that copied the extraction loop with one that runs
ZIMExtractionService on the bundled 100-article ZIM. It checks that
chained batches return every article exactly once, and that a job
queued by an older build (no saved position) lands on the same next
position as the new path. Moving the dirent counter above the batch
break fails it.
2026-11-17 22:18:34 +00:00
Aaron Van Tassle 1d6becd923 fix(rag): seek ZIM batches instead of rescanning from the start 2026-11-17 22:18:33 +00:00
Yi-111-a 8033e9dc0c fix(test): drop unused test callback arg in formatSpeed spec
tsc fails the admin build with TS6133 on the unused `t` parameter.
2026-11-17 22:18:33 +00:00
Yi-111-a 85085c2c7d fix(downloads): pick formatSpeed's unit after rounding
The three formatSpeed copies chose the unit from the raw speed and then
rounded, so a speed just under 1024 of a unit displayed as 1024 B/s or
1024.0 KB/s instead of 1.0 KB/s / 1.0 MB/s. The shared one in
app/utils/misc.ts now rounds first and moves to the next unit when the
rounded value crosses its floor, gains the <= 0 guard the component
copies had, and the components import it (like ChatModal imports
parseBoolean) instead of keeping their own diverging copies.

Fixes #1554
2026-11-17 22:18:32 +00:00
Chris SherwoodandClaude Opus 5.5 f45d79acef fix(ui): refresh the sidebar logs link after saving, simplify the help text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:18:32 +00:00
Yi-111-a 73ba0cc4bd fix(ui): let the Service Logs sidebar link honor a custom URL
#991 added custom_url overrides for app launch links, but the Settings
sidebar's "Service Logs & Metrics" entry still built its href from just a
port: getServiceLink('9999') in SettingsLayout.tsx.

Dozzle is a management-compose container (nomad_dozzle), not a `services`
row, so that override has nothing to attach to and the link always
resolved to http://<current-host>:9999. For anyone reaching NOMAD through
a reverse proxy or a local DNS name — the exact audience #991 served — the
logs link is broken with no workaround in the UI.

Add a KV-backed ui.serviceLogsUrl override, editable under Advanced >
Reverse Proxy, and route the sidebar entry through getServiceLink's
existing customUrl argument. With nothing set the link is unchanged.

Validation accepts a full http(s) URL or a bare host (normalizeCustomUrl
prepends http://), treats empty as "clear", and refuses a declared
non-http(s) scheme so an input like file:///etc/passwd is rejected at the
boundary instead of being silently reinterpreted as a hostname.
2026-11-17 22:18:31 +00:00
jakeaturner c922d98c01 fix(gpu): stop Intel iGPUs passing as discrete cards and skip the verdict for external Ollama
Closes two gaps in the Intel "unsupported" fallback in #1404, the first
an existing bug and the other a hardening of the #1404 work:

- isDiscreteGpuVendor matched /ati/ anywhere in the vendor string, and
  "Intel Corporation" contains "ati". An Intel iGPU with a small lspci
  VRAM reading was flagged as a discrete card with bogus VRAM. That set
  lspciNeedsProbe, so the box stayed at no_gpu and wouldn't reach the
  unsupported branch. It now uses classifyGpuVendor, which keeps all
  vendor matching in gpu_model.ts.

- An Intel host using ai.remoteOllamaUrl, or a custom local Ollama image,
  can run inference on a GPU this host's lspci cannot see. A reachable
  external Ollama (getExternalOllamaGpuInfo) now vetoes the unsupported
  verdict, so those setups don't show a false "runs on CPU" banner.
2026-11-17 22:18:31 +00:00
Yi-111-a cca03e6baf fix(gpu): report an Intel GPU as unsupported instead of healthy
The health probe's fallback branch set status 'ok' and
ollamaGpuAccessible: true purely because si.graphics() returned a
controller. On an Intel-only box that is the Core Ultra case in #1325:
the controller is there, but NOMAD only ships CUDA and ROCm paths and
Ollama has no Intel backend, so inference runs CPU-only while Settings
> System reports a healthy GPU.

Adds an 'unsupported' status, set only when no reported controller
belongs to a vendor NOMAD can accelerate. NVIDIA and AMD boxes keep the
existing behaviour, and an unrecognised vendor string is deliberately not
flagged so a healthy card behind a newer pci.ids is never turned into a
false alarm.
2026-11-17 22:18:30 +00:00
jakeaturner 0a5f87abc4 fix(apps): migration for broken Ollama ui_location
Builds on #1584 work from @FuryNocturn and runs a one-off migration to repair the broken
`ui_location = '11434'` that NOMAD would save for the Ollama app row before the fix
from #1584
2026-11-17 22:18:30 +00:00
FuryNocturnTV 43d2b20d1e fix(apps): keep a path UI location when editing an app
Editing a curated app replaced its ui_location with the first host port.
The AI Assistant opens at /chat and publishes Ollama's API on 11434, so
after any edit its tile opened the API and showed "Ollama is running".
Keep the existing location when it is a path.

Fixes #1581
2026-11-17 22:18:29 +00:00
jakeaturner a6f18b05ab fix(downloads): mark terminal failures correctly when retries are skipped
The worker's failed handler decided a failure was final by comparing
attemptsMade to opts.attempts. An UnrecoverableError (disk full, gated
auth) skips BullMQ's retries and fails on attempt 1 of 10, so that check
never fired. A Wikipedia download that hit a full disk stayed at
"downloading", and failed auto-updates never advanced their backoff.

Use job.finishedOn instead. BullMQ sets it only when a job moves to the
failed set for good.

User cancels also throw UnrecoverableError, so they now count as
terminal. Exclude them from the auto-update backoff with a shared
RunDownloadJob.CANCELLED_PREFIX, so a cancel can't self-disable an
update.
2026-11-17 22:18:29 +00:00
jakeaturner ca277652ba fix(downloads): recognize selected Wikipedia ZIM even if option list can't be loaded 2026-11-17 22:18:28 +00:00
FuryNocturnTV e3402ea220 fix(downloads): prevent content loss from Wikipedia detection, partial files, cancel and full disks
- Only files of the Wikipedia selector's own variants (same filename stem)
  update the Wikipedia selection. A `wikipedia_en_` prefix match made the
  Medicine tier ZIM take over the selection, lose its InstalledResource row,
  and get deleted when a Wikipedia ZIM was uploaded locally.
- The queue marks a Wikipedia download failed only after retries are spent.
- A finished stream shorter than Content-Length is not installed (the .tmp is
  kept so the next attempt resumes); a 206 whose Content-Range does not
  continue the partial file restarts the download instead of splicing files.
- Cancelling a download or map extract deletes only the staged .tmp, never
  the final path, which may be an installed file with the same name.
- Map extracts write to <file>.tmp and are renamed only on success.
- Downloads check free space before writing (rest of the file + 2 GiB
  headroom) and fail without retries when it does not fit or on ENOSPC.
2026-11-17 22:18:28 +00:00
jakeaturner 0acc024ff1 fix(maps): kill abandoned size estimates instead of letting them run to timeout
The country picker starts a new size estimate on each selection or zoom
change. The browser ignored stale replies, but the server kept pmtiles
dry runs going, which stream range requests from the remote
archive. With the limit now 10 minutes, a few clicks left several
processes running for minutes after the user stopped waiting.

- The controller aborts the dry run when the connection drops before it
  answers. It listens on the ServerResponse, since IncomingMessage 'close'
  fires once the body is read.
- runDryRun passes the signal to execFile and throws
  MapPreflightAbortedError on abort, so it no longer logs 500.
- The picker aborts the request in flight when the selection changes or
  the modal closes.
- Cancel no longer spins for the whole estimate, only while a download is
  being dispatched.

Refs #1258
2026-11-17 22:18:27 +00:00
Chris SherwoodandClaude Opus 5.5 29e26d9457 fix(maps): give the region size estimate 10 minutes, and say so when it times out
The dry-run that sizes a country selection had a 60 s limit. Its runtime
scales with land area, so large selections went over it on ordinary
hardware: Canada alone takes 41 s on a fast box, US+CA+MX 61 s. The user
got a generic 500 with an empty stderr, indistinguishable from a real
failure because pmtiles buffers its output and loses it on SIGTERM.

- Raise the limit to 10 minutes.
- Detect a timeout from execFile's killed/signal/code (isExecTimeout) and
  return a 504 with a plain message instead of a 500.
- Let the country picker show the server's message inline; the call no
  longer goes through catchInternal's generic toast.

Closes #1258

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:18:27 +00:00
jakeaturner 20b8cf0c32 docs: update log rotation behavior code comment 2026-11-17 22:18:26 +00:00
Chris SherwoodandClaude Opus 5.5 27aa47077f fix(docker): cap container logs so they can't fill the root disk
Docker's default json-file log never rotates, and NOMAD set no log options
on any container. On a small root disk an unbounded nomad_admin log filled
/ and took MySQL down with it (#1412).

- management compose: a shared x-logging anchor caps every service at
  3 x 10 MB.
- app containers: the admin now adds the same cap when it creates, updates,
  or migrates a container, but only when the container would otherwise get
  an unbounded json-file log. Another driver, or an existing max-size from
  the user or the daemon's log-opts, is left alone (max-size is not valid
  for most other drivers and would fail the create).
- the update path previously dropped LogConfig entirely; it now carries it
  over.

Closes #1412

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:18:26 +00:00
jakeaturner 23aca597f3 docs: note in config/cors.ts that map routes have separate CORS handling 2026-11-17 22:18:25 +00:00
cclavin fa78a478cc fix(maps): gate CORS on method, narrow /api/maps/ to /styles
/api/maps/ has ten POST/PATCH/DELETE routes under it (download-remote,
extract, marker CRUD, and others). The middleware set
Access-Control-Allow-Origin before checking the method, so those
responses got the header too. Gate emission to GET/HEAD/OPTIONS.

/styles is the only /api/maps/ route another app needs cross-origin
(confirmed against the app that surfaced this bug); match it exactly
instead of the whole prefix. The other three prefixes are served by
AdonisJS's static provider, GET/HEAD only, so they're unaffected.
2026-11-17 22:18:24 +00:00
cclavin 9bf491634d fix(maps): serve map assets with CORS
origin: ['*'] in config/cors.ts never matches a real Origin header,
since @adonisjs/cors only treats '*' as a wildcard when it's the bare
string, not inside an array. So no Access-Control-Allow-Origin is ever
sent, on any route, blocking any other app from reading NOMAD's map
tiles cross-origin.

Add a middleware scoped to the four map asset path prefixes instead of
widening the global config, which would also expose the write API since
credentials: true is already set there. Registered before @adonisjs/cors
so it can answer OPTIONS preflights on map paths itself; the built-in
middleware ends any preflight it can't match an origin for before this
one would otherwise run.
2026-11-17 22:18:24 +00:00
Matthew Marshall 86b187a9ff fix(security): pin the 21 Oct 2026 Node releases
The image was still built from the floating node:22-slim tag, and Qdrant
and Cheerio resolved undici builds below the 6.29.1 and 7.30.1 fixes.
Pin node:22.23.4-slim by digest, run CI on 24.22.1, and lock those
undici versions. This covers CVE-2026-111497 and the TLS and DNS
hostname bugs on the 22 and 24 lines.
2026-11-17 22:18:23 +00:00
Matt Moyles d78eb635e0 fix(docs): stop a Markdoc warning from taking a docs page down
DocsService.parse() threw on every validation finding except
attribute-undefined, warnings included. faq.md has a bold span
hard-wrapped across lines, which Markdoc reports as a child-invalid
warning ("Can't nest 'softbreak' in 'strong'"), so the FAQ page
returned a 500 even though transform() renders it fine.

Only error and critical findings block rendering now. The Markdoc
config moves to app/utils/docs_markdoc.ts so a unit test can validate
every bundled doc against the schema the service uses. The FAQ
sentence is also joined onto one line.

Fixes #1427
2026-11-17 22:18:22 +00:00
Md Tasnimul Hoque dc9b11a924 docs(FAQ): simplify memory requirements section (#1430)
Removed redundant lines about model memory requirements.
2026-11-17 22:18:22 +00:00
cosmistack-bot 54ee30a449 docs(release): finalize v1.35.1 release notes [skip ci] 2026-10-05 22:30:13 +00:00
jakeaturner f257d54a29 chore(docs): update release notes 2026-10-05 22:25:22 +00:00
Chris SherwoodandClaude Opus 5.5 26f40baf58 fix(ai): probe a model the list reports without vision before disabling images
Ollama 0.33.3 gives two answers for gemma3: /api/tags lists it as
['completion'], while /api/show for the same model reports
['completion', 'vision']. getModelCapabilities trusted the list outright
and cached it for the life of the process, so image upload stayed disabled
for gemma3, one of the most common small vision models, even though the
model downloader correctly shows it as text + image. Re-pulling does not
help: the local digest matches the registry.

A list that reports vision is still trusted without probing. A list that
omits it is no longer conclusive: the model is probed through /api/show
(then llama.cpp /props), and the list's answer stands only when the probes
have nothing better, which keeps hybrid routers without /api/show working.
The service's own copy of the short-circuit is removed so the rule lives in
the one tested function.

Verified on NOMAD3 (v1.35.0 + this patch): installed-models moves gemma3:4b
from unsupported to supported, every other model unchanged, and a chat with
an attached image is answered correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 14:25:28 -07:00
Chris SherwoodandClaude Opus 5.5 ee203df485 fix(translate): download every released language, and list them in the docs
fetch_models.py sorted versions with float(), and Firefox Remote Settings
now publishes Nightly pre-releases ("1.0a1") alongside each release. The
first one crashed the whole fetch, so adding Swedish, or 21 of the 34 named
languages, silently did nothing and the button never appeared.

Only take records desktop Firefox would use on the release channel, pick
the newest complete version per direction instead of mixing files across
versions, support pairs that publish a separate source and target vocab
(Japanese), and keep one failing language from stopping the rest.

That opens 50 languages, up from the ~40 the docs claimed, including
Arabic, Japanese, Korean and Thai, which the docs said were unavailable.
All 50 downloaded, loaded and translated on the bergamot 0.4.5 engine in
the shipped image (NOMAD3). Chinese stays out: it is published as
zh-Hans/zh-Hant, which the proxy's two-letter codes cannot carry yet.

Translated pages now send Cache-Control: no-cache and put the installed
language set in the ETag. Kiwix's max-age=3600 kept the old language bar
for up to an hour after a language was added, and a normal refresh does
not reach the article frame.

Docs: step-by-step instructions and the full code table in the Supply
Depot section; sizes corrected to 45-140 MB per language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 14:19:27 -07:00
Chris SherwoodandClaude Opus 5.5 eef5b6cd37 fix(translate): forward upstream redirects instead of following them
urlopen() follows redirects silently. Kiwix answers a book root such as
/content/<book> with a 302 to the ZIM's main page, so the proxy served
that page's HTML at the original, shallower URL. Every relative link and
stylesheet then resolved one directory too high: the page lost its
styling and every article link 404'd (e.g. atenolol/ -> /content/atenolol/).
Kiwix's /random is a 302 too and broke the same way.

Use an opener that returns 3xx to the browser like any other non-200
response, and keep an absolute Location on this origin rather than the
upstream container name.

Bumps the catalog image to 0.1.1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 14:19:27 -07:00
cosmistack-bot b54cb55c1a docs(release): finalize v1.35.0 release notes [skip ci] 2026-09-29 22:56:41 +00:00
jakeaturner ddb0235887 docs: update release notes 2026-09-29 15:54:41 -07:00
jakeaturner c65198c7c3 fix(kb): keep chunk active flags in sync with toggles during embedding
embedAndStoreText read the file's active flag, then upserted its
chunks. A toggle landing between those two steps set its payload
before the new points existed, so the new points kept the old value.
Retrieval and the KB panel then disagreed.

Both toggles (setFileActive and setKnowledgeCollectionActive) now write
kb_ingest_state before calling Qdrant setPayload, and restore the rows
they changed if setPayload fails. embedAndStoreText re-reads the flag
after its upsert and sets active on its own point IDs if the flag
changed. Whichever order the two run in, one of them writes the final
value to the new points.

Also coerce the flag to a boolean before stamping it into the payload.
MySQL returns tinyint(1) as 0/1, and a raw 0 got past the search
filter's must_not active == false, so an inactive file that was
re-embedded became searchable again.
2026-09-29 15:54:41 -07:00
jakeaturner 152d1ee198 fix(kb): persist source active toggle when no ingest state row exists
setFileActive updated the Qdrant payload but skipped the DB write when
a source had no kb_ingest_state row. ZIMs hit this during embedding
(markIndexed runs only after the final batch), after a lost row, or on
pre-RFC installs. The API returned success, getStoredFiles still showed
the file as active, and the switch could never turn it back on. All
chunks stayed excluded from retrieval.

When the row is missing, create it the same way the scanner backfills:
indexed if Qdrant has chunks for the source, pending_decision if not.
Then save the flag.

Creating the row does not affect retrieval, since search filters only
on the Qdrant payload. It also leaves failed or partial embeds no worse
off:
- A failed job already leaves a row via markFailed. Only active changes.
- A crashed worker leaves partial chunks and no row. The next scan
  writes the same indexed row through backfill_indexed.
- For an in-flight job, markIndexed/markFailed reuse the row and keep
  active, so later batches stop stamping chunks active: true.
- The UI already treats a null state as indexed, and stall/zero-chunk
  warnings come from Qdrant counts, so Re-embed still appears.

A partial ZIM with no row is still labeled indexed, as before.
markStalled has no callers, so stalls are not tracked in the row.
2026-09-29 15:54:41 -07:00
jakeaturner bc24508795 fix(maps): stop world basemap provisioning from running pmtiles extract twice 2026-09-29 15:54:41 -07:00
jakeaturner ae1eae78e7 fix(kb): stop orphan sweep from purging an empty but present scan root
Boot runs ensureDirectoryExists() on the zim root, so a separate volume
that failed to mount leaves an empty mountpoint behind. The scan walks it
without error and reports it as scanned. One upload in kb_uploads keeps
the overall scan non-empty, so the next manual sync purged the vectors
for every ZIM under that root.

decideOrphans() now decides per scanned root and returns
{ orphans, withheld }. A root keeps its indexed sources when:

- it holds no embeddable files (kiwix-library.xml does not count)
- the purge would remove more than 50% of its indexed sources and at
  least 5 of them, which points to a wrong or stale mount rather than
  hand deletions

scanAndSyncStorage() logs each withheld root and appends a note to the
sync result message, so the user sees a likely unmounted drive instead
of losing hours of embeddings.

Replaces the unit test that asserted the old empty-root purge with
regression coverage for #1378 and both guards.

Closes #1378
2026-09-29 15:54:41 -07:00
jakeaturner a1b899f49a fix(gpu): keep an existing AMD HSA override across reinstall and update
Upgraded AMD iGPU installs sometimes carry a working
HSA_OVERRIDE_GFX_VERSION on nomad_ollama, set by hand or by an older
install path, but have no ai.amdHsaOverride KV and no .nomad-amd-gfx
marker. The CPU-fallback banner offered Fix: Reinstall, and the
reinstall rebuilt the container without the override, so a 780M
(gfx1103) stayed on CPU.

- Add pickAmdHsaOverride to utils/amd_hsa_override.ts with the
  resolution order KV, marker, existing container override, none.
  A marker still wins even when it maps to none. KV "none" still
  disables the override.
- forceReinstall inspects nomad_ollama before removing it and saves a
  container-only override to ai.amdHsaOverride. Saving it keeps the
  value through a reinstall that fails after the removal and shows it
  in the Set GFX Override modal.
- The update path passes the old container env to the resolver, so a
  routine Update keeps the override too.
- The GPU health check passes the container env, so
  diffAmdOllamaConfig compares against what a reinstall would build.
  On the reported box, the only drift is OLLAMA_IGPU_ENABLE=1.
- diagnoseAmdCpuFallback suggests the container's current override
  when one is set. With an override applied, Ollama logs the coerced
  target (gfx1100), which maps to none and would suggest removing a
  working value.
- Remove the unused _mapGfxToHsaOverride wrapper.

parseAmdGfxTargetFromLogs is unchanged. It still matches only
gpu_type=. The "dropping integrated GPU ... compute=gfx..." line needs
a full sample from an affected box before we can write a regex for it.
We'll address in a later PR.
2026-09-29 15:54:41 -07:00
Chris SherwoodandClaude Opus 5.5 4c75eb512b chore(branding): replace the retired N.O.M.A.D. badge with the new logo
The Command Center header, settings sidebar, chat sidebar and README still
showed the old dotted "PROJECT N.O.M.A.D." badge with the retired backronym.
The earlier naming sweep removed the text strings but could not catch a
raster asset.

Swap in the vector primary badge from the brand kit (nomad-primary.svg) and
add object-contain so the hexagon keeps its true 0.866 aspect instead of
being stretched to fill the square boxes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 15:54:41 -07:00
jakeaturner ac437f8429 fix(gpu): detect Ollama CPU fallback on AMD and offer the right fix
GpuPassthroughRemediationProvider returned early unless the NVIDIA
runtime was registered with Docker. AMD doesn't register one, so the
log-based CPU-fallback detection added in v1.35.0-rc.1 never ran on
AMD boxes. On a Phoenix1 iGPU running ollama:rocm with /dev/kfd and
/dev/dri passed through, Ollama logged library=cpu while gpuHealth
reported status "ok".

The gpuHealth side had its own bug. hasNvidiaRuntime and
hasRocmRuntime were set only inside the lspci probe branch. When lspci
returned a plausible controller, the else branch reported "ok" without
probing and left both flags false. A blind reinstall would not have
helped either: gfx1103 needs HSA_OVERRIDE_GFX_VERSION=11.0.0, and
without the gfx marker or ai.amdHsaOverride a reinstall rebuilds the
same CPU-bound container.

- Add resolveExpectedGpuVendor(). It reads the nomad_ollama container
  config first (nvidia DeviceRequest, ROCm image tag, /dev/kfd), then
  the nvidia runtime, then the AMD GPU type when no container exists.
  /dev/dri alone is not treated as AMD. A CPU container on an AMD box
  is trusted as deliberate (#1232 fallback, acceleration disabled).
- Gate the provider on the expected vendor. NVIDIA auto-reinstall is
  unchanged but now skips when the container requests a GPU with no
  runtime registered. AMD is detect-only: the provider logs whether a
  reinstall would change the container and never reinstalls itself.
- In gpuHealth, set the runtime flags up front and let Ollama's
  startup log decide health whenever a GPU is expected, whatever lspci
  returned. A CPU-only log now reports passthrough_failed and skips
  the nvidia-smi exec. lspci stays the display source when clean.
- Parse the first GPU "inference compute" line instead of the last
  line, which could be the CPU fallback device, and recognize Vulkan.
  Move the startup-log reader into ollama_compute so both callers
  share it.
- Report amdReinstallWouldChange, amdGfxTarget, currentHsaOverride and
  suggestedHsaOverride on AMD passthrough_failed. The gfx target is
  parsed from Ollama's "amdgpu is not supported" line (best-effort).
- Add GpuPassthroughAlert, shared by Settings > System and Settings >
  Models. When a reinstall would rebuild the same AMD container, it
  offers "Fix: Set GFX Override" instead of a reinstall. The dialog
  saves ai.amdHsaOverride and then reinstalls.
- Expose ai.amdHsaOverride through the settings API. The value lands
  in the container env, so only x.y.z, "none" or empty is accepted.
- Silence the HSA override resolver's logging on the gpuHealth poll.

The #1325 case where no GPU runtime is expected and lspci reports a
controller still returns "ok" unprobed.

Fixes #1344
Refs #1325, #1232
2026-09-29 15:54:41 -07:00
dajiaohuang 7dabc40c85 fix: bound custom URL length before persistence 2026-09-29 15:54:41 -07:00
jakeaturner a915cdcfc9 feat(AI): add opt-in relevance check for off-topic retrieval
The post-rerank relevance floor rejects noise but passes coherent
off-topic questions, and it gets worse as the library grows. Adding
Gutenberg prose, the Python tutorial and MDN pages to the eval corpus
took the off-topic leak rate from 22% to 67% at the 0.62 floor.

Score cutoff does not fix it. The weakest correct top hit scores 0.666
while "write me a haiku about autumn leaves" pulls Walden at 0.705.
A cosine floor and a top-vs-median contrast test both cost recall
faster than they cut leaks.

- Add rag.relevanceCheck (default off). After the floor, the tasks
  model, or the chat model when none is set, gives one grammar-constrained
  on_topic verdict for the whole retrieved set. Off topic means no
  context and no citations. Any failure keeps the chunks unjudged.
- Add a Settings > Models toggle recommending an 8B+ tasks model.
  On llama3:8b the check cuts off-topic leaks from 67% to 6% for about
  5 points of core recall@5 and ~0.6s per turn. On 3B models it rejects
  most valid questions, which is why it is opt-in.
- Add 6 distractor documents and an off_topic suite (18 unanswerable
  questions, 7 distractor controls) to the eval corpus.
- Report per-tag leak rates and leaked cases with top scores in
  eval:retrieval. Add --judge-model to measure the check and --dump to
  export pre-floor candidate pools for offline gate simulation.
- Pin the check off in eval:generation so a local setting cannot move
  scores.
- Record the distractor sweep on RAG_MIN_FINAL_SCORE. The 0.62 default
  stays: 0.65 halves leaks at no measured recall cost but leaves only
  0.016 of margin.

The corpus fingerprint changes to b4ebe5dce8699f5d. Retrieval reports
from before this commit are not comparable, and a new baseline is
committed.

Refs #1341
2026-09-29 15:54:41 -07:00
jakeaturner a013eb6394 fix(chat): stop capping answers at 1024 tokens and surface truncation
planPrompt() returned the response reserve as num_predict, and the
reserve was clamped by MAX_RESPONSE_RESERVE = 1024. Chat answers
stopped at 1024 output tokens regardless of window size, often
mid-sentence, and the normalized stream chunks dropped Ollama's
done_reason, so neither the UI nor API clients could discern between
a cut-off answer and a finished one.

- Decouple the generation cap from the reserve. num_predict is now the
  space left in the window after the prompt, less a 5% (min 64 token)
  margin for estimator error, with the reserve as its floor. Raise
  MAX_RESPONSE_RESERVE to 8192 so it only bounds prompt hold-back.
- Carry done_reason through all four OllamaService chat paths. Native
  forwards Ollama's done_reason; compat maps OpenAI's finish_reason.
- Log length-limited stops in OllamaController with num_predict,
  num_ctx and tokens generated.
- Show a truncation notice on cut-off answers, with a Continue button
  on the latest one that sends a normal follow-up turn.

Generation evals before and after this change are not length
comparable.

Closes #1342
2026-09-29 15:54:41 -07:00