[PR #1807] [CLOSED] config: forward - POSTs to a path answered by another server (embeddings, reranking) #3688

Closed
opened 2026-11-07 15:30:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1807
Author: @gt50
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: forward


📝 Commits (2)

  • fded2c1 config: forward, POSTs to a path answered by another server (embeddings, reranking)
  • 83a2834 config: forward refuses every POST path Strata answers itself, read from _post by a test

📊 Changes

3 files changed (+170 additions, -1 deletions)

View changed files

📝 docs/DETAILS.md (+7 -0)
📝 serve/server.py (+72 -0)
📝 serve/test_server.py (+91 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1807 **Author:** [@gt50](https://github.com/gt50) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `forward` --- ### 📝 Commits (2) - [`fded2c1`](https://github.com/Niko1221/Strata/commit/fded2c15d9aa71f1e5c10cec4d8ce4121152b48d) config: forward, POSTs to a path answered by another server (embeddings, reranking) - [`83a2834`](https://github.com/Niko1221/Strata/commit/83a2834e6baa4f595671adf89b271a48ebf73808) config: forward refuses every POST path Strata answers itself, read from _post by a test ### 📊 Changes **3 files changed** (+170 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+7 -0) 📝 `serve/server.py` (+72 -0) 📝 `serve/test_server.py` (+91 -1) </details> ### 📄 Description ## 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3688
No description provided.