chore: initial commit of Go API gateway
Baseline for the Kong replacement on api.riotpiao.com. Brings the working tree under version control for the first time: gateway source, the task board that drives the agent runs, test fixtures, and K8s manifests. Anchor the gateway ignore rule to the repo root. Unanchored, "gateway" also matched the cmd/gateway/ source directory, so the program entrypoint was excluded from every commit. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# 2.7 — `POST /v1/rerank` path rewrite (GREEN)
|
||||
|
||||
Phase: 2 — LLM surface
|
||||
Stage: GREEN
|
||||
Depends on: [2.1](2.1-model-registry.md), [1.1](1.1-reverse-proxy.md)
|
||||
|
||||
- [ ] `POST /v1/rerank` reaches `reranker-predictor.llm-serving:80` at the path `/rerank`
|
||||
- [ ] The rewrite is expressed in the route configuration, not special-cased in dispatch code
|
||||
- [ ] The request body is forwarded byte-identical, and the upstream response body is returned byte-identical
|
||||
- [ ] The route's connect timeout is 10s and its read and write timeouts are 10m, explicit in configuration
|
||||
- [ ] The route has an explicit body size cap
|
||||
- [ ] A request to `/v1/rerank` never reaches the upstream as `/v1/rerank`
|
||||
|
||||
TEI does not serve `/v1/rerank`: probing it returned 404, while `/rerank` returned 405
|
||||
for the wrong method — that is how the correct upstream path was established. The
|
||||
model served here is `BAAI/bge-reranker-base`. Port is 80, not 8080. This is the only
|
||||
route in the LLM surface that rewrites its path.
|
||||
|
||||
## Verify
|
||||
|
||||
```bash
|
||||
curl -s -i localhost:8080/v1/rerank -H 'content-type: application/json' \
|
||||
-d '{"model":"BAAI/bge-reranker-base","query":"q","texts":["a","b"]}'
|
||||
# expected: 200, reranker stub recorded exactly one hit at path /rerank and zero at /v1/rerank
|
||||
```
|
||||
Reference in New Issue
Block a user