haiku.rag/pyproject.toml
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

168 lines
4.2 KiB
TOML

[project]
name = "haiku.rag"
description = "Local-first agentic RAG with citations - hybrid search, reranking and multimodal retrieval over your own documents, no database server required"
version = "0.75.0"
authors = [{ name = "Yiorgis Gozadinos", email = "ggozadinos@gmail.com" }]
license = { text = "MIT" }
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.12"
keywords = [
"RAG",
"agentic-rag",
"lancedb",
"vector-database",
"hybrid-search",
"reranking",
"multimodal-rag",
"embeddings",
"citations",
"document-ingestion",
"mcp",
"mcp-server",
"pydantic-ai",
"docling",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows :: Windows 10",
"Operating System :: Microsoft :: Windows :: Windows 11",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
]
dependencies = [
"haiku.rag-slim[docling,voyageai,cohere,zeroentropy,tui,cross-encoder,jina]==0.75.0",
]
[project.urls]
Homepage = "https://ggozad.github.io/haiku.rag/"
Documentation = "https://ggozad.github.io/haiku.rag/"
Repository = "https://github.com/ggozad/haiku.rag"
Issues = "https://github.com/ggozad/haiku.rag/issues"
Changelog = "https://ggozad.github.io/haiku.rag/changelog/"
[project.scripts]
haiku-rag = "haiku.rag.cli:cli"
[project.optional-dependencies]
tui = ["textual>=8.2.4"]
s3 = ["haiku.rag-slim[s3]==0.75.0"]
cross-encoder = ["haiku.rag-slim[cross-encoder]==0.75.0"]
ingester = ["haiku.rag-slim[ingester]==0.75.0"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build]
exclude = [
"/docs",
"/examples",
"/tests",
"/docker",
"/.github",
"/haiku_rag_slim",
"/evaluations",
]
[tool.hatch.build.targets.wheel]
only-include = ["/README.md"]
[tool.uv.workspace]
members = ["haiku_rag_slim", "evaluations"]
[tool.uv.sources]
"haiku.rag-slim" = { workspace = true }
"haiku.rag-evals" = { workspace = true }
[dependency-groups]
dev = [
"haiku.rag-evals",
"haiku.rag-slim[ingester]",
"zensical",
"pre-commit>=4.5.1",
"pydantic-ai-slim[anthropic]",
"pydantic-ai-slim[bedrock]",
"pydantic-ai-slim[google]",
"pydantic-ai-slim[groq]",
"ty>=0.0.28",
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.1.0",
"pytest-recording>=0.13.4",
"pytest-xdist>=3.8.0",
"ruff>=0.15.9",
]
[tool.ruff]
line-length = 88
src = ["haiku_rag_slim"]
# Enable Flake's "E" and "F" codes by default and "I" for sorting imports.
# Exclude a variety of commonly ignored directories.
[tool.ruff.lint]
select = [
"E",
"F",
"UP",
"I",
] # Enable Flake's "E" and "F" codes by default and "I" for sorting imports
ignore = ["E501"]
per-file-ignores = { "__init__.py" = ["F401", "F403"] }
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.isort]
known-first-party = ["haiku"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ty.src]
exclude = ["examples/**"]
[tool.ty.environment]
python-version = "3.12"
python = ".venv"
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "session"
asyncio_mode = "auto"
addopts = "-n auto"
testpaths = ["tests"]
norecursedirs = ["examples", "docs", "evaluations", ".git", ".venv"]
markers = [
"integration: marks tests as integration tests (require external services)",
]
# pyproject.toml
filterwarnings = ["error", "ignore::UserWarning", "ignore::DeprecationWarning"]
[tool.coverage.run]
source = ["haiku_rag_slim"]
# aiosqlite runs sqlite (and the queue's PRAGMA connect listener) off the main
# flow via a greenlet + worker thread; track both so that code isn't reported
# as uncovered.
concurrency = ["greenlet", "thread"]
omit = [
"haiku_rag_slim/haiku/rag/chat/*",
"haiku_rag_slim/haiku/rag/inspector/*",
]
[tool.coverage.report]
show_missing = true
fail_under = 100
exclude_also = [
"if TYPE_CHECKING:",
"@abstractmethod",
"raise NotImplementedError",
]