qfa.adapters#

Driven adapter implementations.

Adapters in this package implement driven ports declared in qfa.domain.ports and are the only modules in the codebase that import third-party infrastructure libraries (LLM SDKs, anonymisation engines, etc.). The application service layer (qfa.services) and domain (qfa.domain) depend on the ports, never on these implementations directly.

Submodules

db

Database engine, session factory, SQL schema, and auth adapter.

embedding

Self-hosted ONNX embedding adapter (multilingual, dense-only).

env_auth

Environment-based authentication lookup adapter.

llm_client

LLM client adapter using LiteLLM for unified provider access.

presidio_anonymizer

Presidio-based anonymisation adapter.

tracking_llm

LLM port decorator that records every call attempt for usage tracking.

usage_repository

SQLAlchemy-backed usage repository.