Commit graph

39 commits

Author SHA1 Message Date
Yiorgis Gozadinos
2310b7a8b3
Add per-endpoint api_key to model and embedding config 2026-08-23 23:54:40 +03:00
Yiorgis Gozadinos
72ef18e39d
Reject unknown and out-of-range configuration values
Every section inherited plain BaseModel, so unknown keys were dropped
silently: providers.docling_serve.timeout was documented for months while
being ignored, and a typo in any setting took the default. Sections now
derive from ConfigModel, which forbids extras, so a stale or misspelled key
fails with its path. This already found search.context_radius in a live app
config and providers.vllm in soliplex's example.

converter, chunker and chunker_type are Literals. Sizes, limits,
dimensions, token budgets, attempt counts and breaker thresholds must be
positive; retention, delays, intervals and cooldowns non-negative;
similarity_threshold within 0-1; port within 0-65535. port 0 keeps its
OS-assigned meaning and worker_count allows 0 for an API-and-reaper-only
process.

get_reranker caught ImportError and returned None, so a configured reranker
whose extra was missing silently disappeared. It now propagates.
raise_missing_extra names the install command and re-raises when the failure
came from inside an installed package, so a broken transitive import is not
reported as a missing one. zeroentropy imported bare and now guards like the
others.

The haiku.rag package declares the jina extra. jina-local already worked
there through cross-encoder's transitive transformers and torch; the
resolved package set is unchanged, but the support is now promised rather
than inherited.

Provider fields stay unconstrained: get_model ends in a pass-through to
pydantic-ai for any provider it supports, so a Literal there would reject
valid configurations.
2026-08-19 15:32:51 +03:00
Yiorgis Gozadinos
e8f00fcff4
Make get_config the only configuration lookup
haiku.rag.config exported two configuration instances: the lazy _config
behind get_config/set_config, and Config, loaded at import time. Nothing
linked them, and eleven signatures captured Config as a default argument,
so set_config could not reach the factories, the client, the store or the
MCP server. reranking/base.py went further and snapshotted the configured
reranker name into a class attribute at import.

Config is removed. Internal defaults are config: AppConfig | None = None,
resolved through get_config() per call. RerankerBase._model is None and
CohereReranker takes its model name as an argument, like every other
reranker.

The suite patched attributes on Config while production read the instance
get_config() returns, a different object, so those patches were no-ops
waiting to happen. They now go through get_config().
2026-08-19 14:43:40 +03:00
Yiorgis Gozadinos
d63199d96d
Keep cross-encoder rerank scores apart when they saturate
mxbai-rerank-base-v2 ships a Sigmoid activation and evaluates it in bf16, so
every strongly-relevant candidate rounds to exactly 1.0. Ties then leave the
order to the stable sort, which preserves the incoming hybrid ranking: on 100
t2_finqa retrieval cases the reranker scored MAP 0.661 against 0.659 with no
reranker at all, and 0.742 once the scores separate.

Ask the model for logits and apply the sigmoid here, where it runs in float64.
Scores stay 0-1, matching the cohere, vllm and zeroentropy rerankers.

Also drop the remaining pyright references; the project type-checks with ty.
2026-08-07 14:07:53 +03:00
Yiorgis Gozadinos
1e8e5e9f6f
Cover MCP, ingester and converter error paths
Add tests for the MCP tools' degradation contracts, malformed WebDAV
multistatus bodies, dry-run poller sweeps including the circuit-open and
discover-failure paths, FS source scheme and symlink handling, docling-serve
zip parsing, and the remaining embedding and reranker helpers. Parametrize
_strip_etag.

Drop the misplaced pragma on the analyze handler, which sat on the return and
left the except uncovered. Add one on the FS symlink OSError guard, which
resolve(strict=False) absorbs for every real link.
2026-07-26 19:14:26 +03:00
Yiorgis Gozadinos
543aba7547
Multimodal reranking: send picture chunks to vllm rerankers as images
reranking.multimodal (vllm provider only) attaches picture bytes to
synthetic picture chunks before rerank; VLLMReranker sends them as
content-parts documents (base64 data URI + description text) in the
same /v1/rerank request as plain text documents.
2026-07-24 12:29:20 +03:00
Yiorgis Gozadinos
144900d385
Remove the mxbai reranking provider 2026-07-14 11:09:55 +03:00
Yiorgis Gozadinos
5e2a928013
Allow transformers 5.x in the mxbai extra 2026-07-14 11:09:55 +03:00
Yiorgis Gozadinos
c02bcd5dc9
Pool HTTP clients for vLLM embedding and vLLM/Jina reranking 2026-07-09 10:32:44 +03:00
Yiorgis Gozadinos
38079ff89a
Hoist reranker empty-input guard into base; stop factory tests loading models 2026-06-29 14:20:23 +03:00
Yiorgis Gozadinos
5de4d50622
coverage 2026-05-14 15:54:43 +03:00
Yiorgis Gozadinos
57f273e000
Minor fixes, CI should build 2026-05-14 15:43:36 +03:00
Yiorgis Gozadinos
519afe6709
Add cross-encoder reranking provider 2026-05-14 15:43:35 +03:00
Yiorgis Gozadinos
b64d9721bb
Mark with pragma no cover areas that are just wiring. Consolidate tests and bring coverage to 100% 2026-02-13 11:56:37 +02:00
Yiorgis Gozadinos
ce95dc47a5
Do not run coverage on download-models & code that requires integration tests 2026-01-21 11:09:35 +02:00
Yiorgis Gozadinos
36a675e1bb
Add jina, mxbai and sentence-transformers to download-models when used 2026-01-21 10:53:45 +02:00
Yiorgis Gozadinos
7ff014684a
Support for jina reranker, both local and API 2026-01-21 10:39:21 +02:00
Yiorgis Gozadinos
b8cf8f5198
Remove reranker cache 2026-01-20 17:26:24 +02:00
Yiorgis Gozadinos
1dc40abab3
get_reranker() tests 2025-12-29 17:13:14 +02:00
Yiorgis Gozadinos
1e9a10a235
Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
Yiorgis Gozadinos
c3a3b4a5b4
Extended VCR cassette recording to embedder, client, research graph, and search filter tests 2025-12-26 18:53:17 +02:00
Yiorgis Gozadinos
958fe43f2a
Remove vllm and lmstudio custom configs, they can now use the openai base 2025-12-26 12:02:55 +02:00
Yiorgis Gozadinos
ed809759d5
Fix mxbai rerank default model 2025-12-10 11:39:33 +02:00
Yiorgis Gozadinos
a9701616c8
Rename model to name under model 2025-11-25 12:28:43 +02:00
Yiorgis Gozadinos
1bb7b6d5bd
Add support for per-model configuration settings including thinking, temperature and max_tokens 2025-11-25 12:14:24 +02:00
Yiorgis Gozadinos
d19d2b7f00
Fix tests 2025-10-31 12:50:08 +02:00
Yiorgis Gozadinos
2f00686605
Support for zero entropy reranker 2025-10-30 13:36:44 +02:00
Yiorgis Gozadinos
469d993542
Remove provider API keys from config, rely on environment variables for those 2025-10-23 13:52:57 +03:00
Yiorgis Gozadinos
618b3ffd5f
Refactor config from flat to nested Pydantic models 2025-10-23 13:30:21 +03:00
Yiorgis Gozadinos
f2847d0524
Reranking support for vLLM, documentation update 2025-09-04 13:13:10 +03:00
Yiorgis Gozadinos
fe850e778d
Remove Ollama reranker, this was a bad idea 2025-09-02 11:42:31 +03:00
Yiorgis Gozadinos
b83596ff07
Basic moving to lancedb. 2025-09-01 14:56:14 +03:00
Yiorgis Gozadinos
26a3715902
Refactor Ollama reranker around pydantic AI 2025-08-15 21:26:16 +02:00
Yiorgis Gozadinos
5103e6c2d7
Add Ollama reranker 2025-08-10 20:50:17 +02:00
Yiorgis Gozadinos
8d98eed2e2
Make mxbai reranker optional. Only use a reranker if mxbai or cohere are installed 2025-08-10 19:49:14 +02:00
Yiorgis Gozadinos
2343ab7751
Return tuple (Chunk, score,) in rerank() 2025-07-19 12:16:17 +03:00
Yiorgis Gozadinos
f25416b0ff
Properly test cohere reranker 2025-07-18 20:55:28 +03:00
Yiorgis Gozadinos
044e1b0a06
mixedbread reranker as default 2025-07-18 20:29:24 +03:00
Yiorgis Gozadinos
859860318a
Cohere reranker 2025-07-17 13:17:16 +03:00