Pull requests / #1807

#1807 config: forward - POSTs to a path answered by another server (embeddings, reranking)

open · @gt50 · 0 Kommentare · Auf GitHub

Setup & installServer & APIAMD / HIPSecurityDocumentationWindows

Beschreibung

## Title
Config: "forward", POSTs to a path answered by another server (embeddings, reranking)

## Summary
Clients that expect `/v1/embeddings` and `/v1/rerank` beside the chat model, as llama-server or LM Studio provide, can't use them with Strata today (404). `"forward": {"/v1/embeddings": "http://127.0.0.1:8081/v1/embeddings"}` passes POSTs to those paths to another server and its answer back as it came, so those clients keep one base URL. Split out of #1789 (which now only carries the Windows AMD images), as AGENTS.md asks: one change per PR, a new feature opt-in.

## What changed
- **`serve/server.py`:**
  - `forward_of()`: paths start with `/` and can't be Strata's own (`OWN_API_PATHS`, `/v1/responses*`); URLs are http(s); anything else is a config error at start.
  - The handler's `_forward()` runs after Strata's Host, API-key and web-page checks, and does not send Strata's API key on.
  - A server that doesn't answer gives `502` with `code: forward_failed`. The start log names each forward.
- **Docs:** `docs/DETAILS.md`.

## Extra Notes
- **Checked on Windows:** `llama-server --embedding` with Qwen3-Embedding-0.6B at 127.0.0.1:8081, reached through Strata from the host and from a Docker container. A client's search by meaning found the right document for 8 of 8 test questions.
- **Default path:** without the key nothing is forwarded, and unknown paths still give 404 (tested).
- **Tests:** `serve/test_server.py` `Forward`, against a local side server: status and body passed back, no Authorization sent on, 502 when down, the config checks. All `serve` and setup test files pass on `main` 61b3fb5d (1155 tests; rebased).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Mehr auf der Site

Links zu Install, Modellen, Releases.