Skip to content

fix(local-ai-app-integration): correct endpoint paths, Linux NPU row, and unpulled-model behaviour - #150

Open
AMD-melliott wants to merge 1 commit into
amd:mainfrom
AMD-melliott:fix/app-integration-endpoints
Open

fix(local-ai-app-integration): correct endpoint paths, Linux NPU row, and unpulled-model behaviour#150
AMD-melliott wants to merge 1 commit into
amd:mainfrom
AMD-melliott:fix/app-integration-endpoints

Conversation

@AMD-melliott

Copy link
Copy Markdown

Description

Verified against a live lemonade-server 11.5.2 on a Ryzen AI MAX+ PRO 395
(Strix Halo / gfx1151, XDNA 2 NPU, Linux).

This PR:

  • Anthropic SDK base_url. The documented value pointed base_url at
    .../api/v1, but the SDK appends /v1/messages itself, so the first call
    requested /api/v1/v1/messages and 404s. Corrected to the bare
    http://127.0.0.1:{port}, since Lemonade serves Anthropic Messages at
    /v1/messages, outside the /api/v1 prefix. Reproduced end-to-end in a
    real Anthropic-Messages client.
  • reference.md route table. POST /api/v1/messages 404s; corrected,
    and both exceptions to the /api/v1 pattern are now called out together.
    Also adds reranking: the proxy serves /api/v1/reranking, while
    /v1/rerank (the spelling used by Jina, Cohere, vLLM, and llama.cpp)
    404s on the proxy even though the supervised back-port serves it.
  • New Step 7 row: a 404 body carrying a path field means a routing
    mistake, not a missing model.
  • Removed the Linux NPU speech-to-text row (whisper-v3-turbo-FLM /
    flm). No NPU backend installs on Linux at 11.5.2 — whispercpp:npu and
    ryzenai-llm:npu require Windows, and flm:npu gates on an NPU family
    string that reports empty on Linux even on XDNA 2 hardware. This also
    removes a contradiction with the existing "Windows NPU path only" example.
  • Unpulled-model behaviour. At 11.5.2, an unpulled model doesn't return
    an empty 200; the first inference blocks until the download completes,
    which collides with the mandatory 120s timeout and presents as a hang, not
    a blank response. Documents both symptoms, notes both are fixed by the
    same explicit pull, and reframes the pull step around latency control
    rather than silent failure. Also notes GET /api/v1/models returns
    downloaded models only, so name validation needs ?show_all=true.
  • Minor: fixes a miscounted list in Step 1, and clarifies that Windows
    has no graceful shutdown equivalent (the original wording implied Windows
    just needs a harsher kill signal).

… and unpulled-model behaviour

Verified against a live `lemonade-server 11.5.2` on a Ryzen AI MAX+ PRO 395
(Strix Halo / gfx1151, XDNA 2 NPU, Linux). Each change below is a reproduction,
not a review comment.

Endpoint paths (Step 5 client table, reference.md route table):

- `@anthropic-ai/sdk` `base_url` must be the bare `http://127.0.0.1:{port}`,
  not `.../api/v1`. The SDK appends `/v1/messages`, so the documented value
  requests `/api/v1/v1/messages` and 404s on the first call. Lemonade serves
  Anthropic Messages at `/v1/messages`, outside the `/api/v1` prefix.
  Reproduced end-to-end in a real Anthropic-Messages client.
- reference.md listed `POST /api/v1/messages`, which 404s. Corrected, and both
  exceptions to the `/api/v1` pattern are now called out together.
- Added reranking: the proxy serves `/api/v1/reranking`. `/v1/rerank` — the
  spelling used by Jina, Cohere, vLLM, and llama.cpp — 404s on the proxy even
  though the supervised back-port serves it.
- Added a Step 7 row: a 404 body carrying a `path` field is a routing mistake,
  not a missing model.

Linux NPU (Step 2 profile table, reference.md recipe tables):

- Removed the "Speech-to-text (Linux NPU) -> whisper-v3-turbo-FLM / flm" row.
  No NPU backend installs on Linux at 11.5.2:
      whispercpp:npu   -> Requires Windows
      ryzenai-llm:npu  -> Requires Windows
      flm:npu          -> Requires AMD XDNA 2 AMD NPU
  The last is a device gate that cannot pass on Linux, where `system-info`
  reports `amd_npu.family: ""` on hardware that is XDNA 2. This also removes a
  contradiction with the existing "# Windows NPU path only" packaging example.

Unpulled models (Step 6, Step 7, verification checklist):

- At 11.5.2 an unpulled model does not return an empty 200; the first inference
  blocks until the download completes. That collides with the mandatory 120s
  timeout and presents as a hang, not a blank. Both behaviours are now
  documented, both cured by the same explicit pull, and the pull step is
  rejustified around latency control rather than silent failure.
- `GET /api/v1/models` returns downloaded models only (23 vs 145 catalogued on
  the test host). Model-name validation needs `?show_all=true`.

Also: Step 1 said "record three things" above a four-item list; the shutdown
note read as though Windows needs the harsher call, when the real point is that
Windows has no graceful equivalent, so the wait is what matters.
@danielholanda

Copy link
Copy Markdown
Collaborator

@AMD-melliott Thanks for the PR
@iswaryaalex Can you please take a look?

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