WeKnora/internal/models/embedding
wizardchen 200c344065 feat(models): cap background embedding concurrency per model
Extend the per-model background concurrency governor to embedding, the
highest-volume background model call (document ingestion vectorises every
chunk, so a batch upload can burst the whole worker pool against one provider).

The wrapper sits innermost (below debug/langfuse) because BatchEmbedWithPool
fans a batch out into per-sub-batch BatchEmbed calls via the pooler, and the
pooler invokes BatchEmbed on whichever Embedder is threaded down as `model`;
sitting innermost routes those per-sub-batch provider round-trips through Gate
so the semaphore bounds real concurrent calls rather than one coarse per-doc
unit. Only background (asynq) calls are throttled; interactive query embedding
is never gated.
2026-07-09 20:40:51 +08:00
..
aliyun.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
azure_openai.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
azure_openai_test.go Add embedding dimension override support 2026-06-15 19:18:19 +08:00
batch.go refactor: Update tenant ID handling across the application 2025-11-25 16:30:54 +08:00
concurrency_wrapper.go feat(models): cap background embedding concurrency per model 2026-07-09 20:40:51 +08:00
concurrency_wrapper_test.go feat(models): cap background embedding concurrency per model 2026-07-09 20:40:51 +08:00
config_from_model_test.go Add embedding dimension override support 2026-06-15 19:18:19 +08:00
dimensions_policy_test.go Add embedding dimension override support 2026-06-15 19:18:19 +08:00
embedder.go feat(models): cap background embedding concurrency per model 2026-07-09 20:40:51 +08:00
gemini.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
gemini_test.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
jina.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
langfuse_wrapper.go feat(observability): integrate Langfuse for LLM token tracking and tracing 2026-04-24 10:29:19 +08:00
llm_debug.go Add embedding dimension override support 2026-06-15 19:18:19 +08:00
nvidia.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
ollama.go Add embedding dimension override support 2026-06-15 19:18:19 +08:00
openai.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
openai_test.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
transport.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
transport_test.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
volcengine.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
weknoracloud.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00
zhipu.go fix(embedding): add SSRF validation and safe HTTP client for embedders 2026-06-26 22:41:04 +08:00