Commit 672a85b
feat: cloud-proxy backend + routing + middleware stack
Big-bang squash-friendly commit covering the work since master:
phases 1-7 of the cloud-proxy migration, tool-call support, plus
the surrounding routing / middleware / PII / billing scaffolding
this branch had been carrying.
Cloud-proxy backend (backend/go/cloud-proxy/):
* New gRPC backend with two modes.
* Passthrough: Forward RPC shovels raw HTTP between client and
upstream so the wire format is preserved byte-for-byte.
* Translate: PredictRich / PredictStreamRich convert internal
proto to OpenAI Chat Completions or Anthropic Messages,
preserving tool calls + usage tokens through pb.Reply.
* API keys resolved from api_key_env or api_key_file (mutually
exclusive), never stored in YAML.
gRPC interface (pkg/grpc/):
* Forward bidi RPC added to Backend proto.
* AIModelRich optional extension interface returning *pb.Reply
so backends can surface tool_calls and usage tokens.
* Fixed forwardClient.CloseSend prematurely closing the gRPC
connection — caught by e2e tests. Cleanup now fires on stream
end (Recv error/EOF) instead.
Core integration:
* IsCloudProxyBackendPassthrough hook in chat + Anthropic
endpoints; legacy "proxy-*" backend prefix removed (hard
cutover — nothing released).
* cloudproxy.ForwardViaBackend + cloudproxy.BuildStreamFilter
shared by both endpoint families.
* PII filter applies to translate mode via the standard
streaming pipeline; verified by e2e.
Routing + middleware (carried from earlier on the branch):
* Score / Rerank / Embedder / VectorStore interfaces in
core/backend with Application factory methods.
* Router with score classifier, depth-1 invariant, embedding
cache, PII config, billing recorder.
* Admission middleware, route-model dispatch, usage stamping.
* MITM proxy + CA management for intercepting cloud traffic.
* Middleware admin page in the React UI.
Local-store backend rewrite + tests covering Set / Get /
Delete / Find invariants.
Llama-cpp Score concurrency guard: conflict_guard tripwire
plus FLAG_SCORE/{CHAT,COMPLETION,EMBEDDINGS} validation rule
in core/config.
Tests: 60+ new unit tests across cloud-proxy backend, cloudproxy
core glue, gRPC server + AIModelRich dispatch, config validation,
and 6 e2e specs that stand up a real two-process gRPC link with
fake upstreams (gaps #1/#2/#3 from review).
Docs: cloud-proxy.md, middleware.md, mitm-proxy.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Richard Palethorpe <io@richiejp.com>1 parent 11d5bd0 commit 672a85b
212 files changed
Lines changed: 24548 additions & 777 deletions
File tree
- backend
- cpp/llama-cpp
- go
- cloud-proxy
- local-store
- python
- transformers
- vllm
- core
- application
- backend
- cli
- config
- meta
- http
- auth
- endpoints
- anthropic
- localai
- mcp
- openai
- middleware
- react-ui
- e2e
- public/locales/en
- src
- components
- contexts
- pages
- utils
- routes
- schema
- services
- cloudproxy
- mitm
- ssewire
- monitoring
- nodes
- routing
- admission
- billing
- contract
- piiadapter
- pii
- router
- docs/content/features
- gallery
- pkg
- grpc
- base
- mcp/localaitools
- httpapi
- inproc
- model
- store
- tests
- e2e-ui
- e2e
- mock-backend
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1213 | 1213 | | |
1214 | 1214 | | |
1215 | 1215 | | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1216 | 1222 | | |
1217 | 1223 | | |
1218 | 1224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
| |||
68 | 84 | | |
69 | 85 | | |
70 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
71 | 104 | | |
72 | 105 | | |
73 | 106 | | |
| |||
81 | 114 | | |
82 | 115 | | |
83 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
84 | 187 | | |
85 | 188 | | |
86 | 189 | | |
| |||
325 | 428 | | |
326 | 429 | | |
327 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
328 | 450 | | |
329 | 451 | | |
330 | 452 | | |
| |||
1002 | 1124 | | |
1003 | 1125 | | |
1004 | 1126 | | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
0 commit comments