Skip to content

fix(local-ai-use): endpoint paths outside /api/v1, STT troubleshooting, per-modality fallback, and model-pull costs - #157

Merged
danielholanda merged 5 commits into
mainfrom
pr-149-local-ai-use-docs
Aug 24, 2026
Merged

fix(local-ai-use): endpoint paths outside /api/v1, STT troubleshooting, per-modality fallback, and model-pull costs#157
danielholanda merged 5 commits into
mainfrom
pr-149-local-ai-use-docs

Conversation

@danielholanda

Copy link
Copy Markdown
Collaborator

Verified against lemonade-server 11.5.2. Four independent fixes to local-ai-use`, found while using the skill end to end:

  • reference.md documents the /api/v1 aliasing rule but only for the three modalities this skill covers, inviting readers to extend it further. Two routes break that pattern: Anthropic Messages is /v1/messages only (/api/v1/messages 404s), and rerank is exposed as /api/v1/reranking (/v1/rerank — the spelling used by Jina, Cohere, vLLM, and llama.cpp — 404s on the proxy). Documented both, and confirmed the harmless case explicitly: for the three modalities this skill does cover, /api/v1/<route> and /v1/<route> are true aliases, so no changes needed there.
  • Speech-to-text failure modes were undocumented. Added two measured 500 model_load_error troubleshooting rows — a cleared RuntimeDirectory= systemd drop-in, and a whisper-server startup abort on the ROCm backend caused by an unbundled comgr dependency (libamd_comgr.so.3 missing from the ROCm backend's own package, only present in a system-wide ROCm install). Also added a Step 1c per-modality backend-health check (lemonade backends --all) and a completion-checklist item, because a working chat/image path does not prove transcription will work — auto resolves backends independently per modality and can silently fall back for one while having none for another.
  • Fallback policy was a single global rule ("only fall back after one failed attempt, with disclosure"). That's correct for image/TTS but wrong for anything index-backed: reranking or embeddings falling back mid-corpus silently corrupts the index, since vectors/scores from a different model aren't comparable to what's already there. Rewrote as a per-modality table in both SKILL.md and templates/local-ai-rule.md.
  • Cost and version-drift gaps: the first image request pulls ~5 GB for SD-Turbo with no warning; --no-install (present but undiscoverable) needed a callout for the managed/shared-machine case where the agent must not run sudo apt-get install; and nothing stated which Lemonade version the skill was verified against, despite model IDs and system-info fields moving between releases. Also pointed reference.md at GET /api/v1/models instead of a server_models.json snapshot that goes stale.

AMD-melliott and others added 5 commits August 18, 2026 11:34
…g, per-modality fallback, and model-pull costs

Verified against `lemonade-server 11.5.2` (~24.04 packaging).

- reference.md invites extending the /api/v1 rule to other modalities but
  documents only the three it covers. Added the two routes that break the
  pattern: Anthropic Messages is /v1/messages only (/api/v1/messages 404s),
  and rerank is exposed as /api/v1/reranking (/v1/rerank, the spelling used
  by Jina, Cohere, vLLM, and llama.cpp, 404s on the proxy). Also confirms the
  harmless case: for the three modalities this skill does cover, /api/v1/
  and /v1/ are aliases, so the mixed spellings elsewhere need no change.
- Add measured STT 500 recovery rows (RuntimeDirectory clearing,
  whisper-server startup failure on the ROCm backend's unbundled comgr
  dependency), a Step 1c per-modality backend-health check, a per-modality
  fallback policy (STT may fall back with disclosure; image/TTS must not
  fall back silently), and a completion-checklist item so a working chat
  path is no longer treated as proof that transcription works.
- Note the ~5 GB SD-Turbo pull on first image request, state the version
  this skill was verified against (model IDs and system-info fields move
  between releases), and point --no-install at the managed/shared-machine
  case where the agent must not run sudo apt-get install.
- reference.md: confirm model IDs against GET /api/v1/models rather than a
  stale server_models.json snapshot.
- Rule template: flag the SD-Turbo pull and GPU contention on the image row
  (coresident is fine, concurrent inference is not).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Addresses all six review threads on this PR:

- Drop both STT 500 troubleshooting rows. The ROCm whisper-server abort
  (exit 134, missing libamd_comgr.so.3) was already reported upstream
  (lemonade-sdk/lemonade#2292) and fixed in #2293, an ancestor of the
  v11.6.0 this skill targets per `git compare`. Running the same lemond
  binary by hand (bypassing this dev box's custom systemd drop-in)
  transcribed successfully over ROCm; running it under that drop-in
  reproduced the abort, so the drop-in's sandboxing -- not Lemonade's
  packaging -- caused it. The RuntimeDirectory row was likewise
  self-inflicted by that same local drop-in; the packaged unit sets
  RuntimeDirectory= correctly. Neither belongs in the skill's general
  troubleshooting table. Step 1c's per-modality backend health check
  stays, since it catches this class of failure without depending on
  either bug.
- Simplify the image-generation row's setup note: drop "ask before
  generating" (unnecessary agent-side indirection) and say "several GB"
  instead of a size tied to one specific model.
- Drop the messages/reranking route-exception section from reference.md;
  out of scope while this skill only routes image/TTS/STT.
- Collapse the per-modality fallback table to one statement, since the
  three shipped modalities all take the same policy (disclosed fallback
  is fine); the embeddings/reranking "never fall back" guidance belongs
  with those modalities if they're ever added, not baked in ahead of them.
- Remove the STT byte-stability note duplicated between the rule template
  and reference.md, keeping the reference.md copy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Addresses all six review threads on this PR, plus two follow-on cleanups:

- Drop both STT 500 troubleshooting rows. The ROCm whisper-server abort
  (exit 134, missing libamd_comgr.so.3) was already reported upstream
  (lemonade-sdk/lemonade#2292) and fixed in #2293, an ancestor of the
  v11.6.0 this skill targets per `git compare`. Running the same lemond
  binary by hand (bypassing this dev box's custom systemd drop-in)
  transcribed successfully over ROCm; running it under that drop-in
  reproduced the abort, so the drop-in's sandboxing -- not Lemonade's
  packaging -- caused it. The RuntimeDirectory row was likewise
  self-inflicted by that same local drop-in; the packaged unit sets
  RuntimeDirectory= correctly. Neither belongs in the skill's general
  troubleshooting table. Step 1c's per-modality backend health check
  stays, since it catches this class of failure without depending on
  either bug.
- Simplify the image-generation row's setup note: drop "ask before
  generating" (unnecessary agent-side indirection) and say "several GB"
  instead of a size tied to one specific model.
- Drop the messages/reranking route-exception section from reference.md;
  out of scope while this skill only routes image/TTS/STT.
- Collapse the per-modality fallback table to one statement, since the
  three shipped modalities all take the same policy (disclosed fallback
  is fine); the embeddings/reranking "never fall back" guidance belongs
  with those modalities if they're ever added, not baked in ahead of them.
- Remove the STT byte-stability caveat from both the rule template and
  reference.md; too in-the-weeds for this skill's general audience.
- Replace the hardcoded "verified against Lemonade 11.5.2" claims in
  SKILL.md and reference.md with version-agnostic guidance (confirm
  against `lemonade status` / `GET /api/v1/models` on the version actually
  installed). The skill already detects capability rather than parsing
  version strings; pinning an exact tested version in the shipped text
  fights that design and goes stale immediately -- it already had, since
  11.6.0 and 11.7.0 shipped after that snapshot was written.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@danielholanda

Copy link
Copy Markdown
Collaborator Author

Please note this PR corresponds to the original #149 PR created by @AMD-melliott .

@danielholanda
danielholanda merged commit a6a77d4 into main Aug 24, 2026
40 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants