WeKnora/internal/models
ordinary being f0adfac334
fix(models/api): cap non-streaming provider response bodies (#4397)
Endpoint.Do bounds the error body at 1 MiB. Thirty lines below it, roundTrip
read the success body whole, and the four chat protocols each did the same in
their own read: a reply was buffered without limit before anything inspected it.
The older models/chat layer already caps the same replies at 20 MiB.

Cap them through one helper, and return an over-cap body without the
TransportError wrapper. withRetry retries only TransportError, and repeating an
oversized reply would bill the request again for the same bytes - the same
reason its own doc gives for not retrying a reply that arrives whole but does
not decode.

64 MiB clears every payload the catalog can legitimately return: an embeddings
batch is bounded by BATCH_EMBED_SIZE (default 5) times the model dimensions, and
a chat reply by the model's output-token ceiling. Streaming replies are
assembled incrementally and are unaffected.
2026-10-16 20:31:42 +08:00
..
api fix(models/api): cap non-streaming provider response bodies (#4397) 2026-10-16 20:31:42 +08:00
asr refactor(models): separate provider definitions, model catalogs, and runtime configuration (#3589) 2026-09-23 14:20:08 +08:00
catalog feat(models): add WeMM embedding presets and Transformers serving (#4238) 2026-10-13 17:22:24 +08:00
chat feat(agent): read chat attachments on demand (#4203) 2026-10-13 14:37:17 +08:00
embedding fix(embed): send images when an OpenAI-compatible row declares them (#4389) 2026-10-16 20:15:32 +08:00
imageprep feat: judge image hits by their image in rerank and show them to vision models (#4013) 2026-10-09 13:01:48 +08:00
internal/configcopy refactor(models): separate provider definitions, model catalogs, and runtime configuration (#3589) 2026-09-23 14:20:08 +08:00
limiter feat(system): expose model concurrency stats on runtime queues dashboard 2026-07-11 07:17:28 +08:00
parity feat(models): add WeMM embedding presets and Transformers serving (#4238) 2026-10-13 17:22:24 +08:00
providers feat(rerank): add Cohere provider for the v2 rerank API 2026-10-12 11:57:53 +08:00
rerank feat(rerank): add Cohere provider for the v2 rerank API 2026-10-12 11:57:53 +08:00
runtime fix(embed): send images when an OpenAI-compatible row declares them (#4389) 2026-10-16 20:15:32 +08:00
utils feat: integrate ChatBot provider and docreader 2026-04-13 17:47:24 +08:00
vlm refactor(image): turn the hard-coded image flow into configurable pipelines (#3746) 2026-10-16 16:18:57 +08:00
capabilities.go refactor(models): separate provider definitions, model catalogs, and runtime configuration (#3589) 2026-09-23 14:20:08 +08:00
legacy_keys.go refactor(models): separate provider definitions, model catalogs, and runtime configuration (#3589) 2026-09-23 14:20:08 +08:00
model.go refactor(models): separate provider definitions, model catalogs, and runtime configuration (#3589) 2026-09-23 14:20:08 +08:00
model_type.go refactor(models): separate provider definitions, model catalogs, and runtime configuration (#3589) 2026-09-23 14:20:08 +08:00