QDrant Loader Core

PyPI Python License: GPL v3

Shared core library for the QDrant Loader ecosystem. It provides a provider‑agnostic LLM layer (embeddings and chat), configuration mapping, safe logging, and normalized error handling used by the CLI and MCP Server packages.

For provider, configuration, and architecture details, use the documentation links below.

🎯 What It Provides

  • Provider-agnostic LLM facade for OpenAI, Azure OpenAI, OpenAI-compatible endpoints, and Ollama
  • Unified async APIs for embeddings and chat clients
  • Typed settings and mapping: LLMSettings.from_global_config(...) supports the new global.llm schema and maps legacy fields with deprecation warnings
  • Structured logging with redaction: LoggingConfig.setup(...) masks secrets and reduces noisy logs
  • Normalized errors: consistent exceptions across providers (TimeoutError, RateLimitedError, InvalidRequestError, AuthError, ServerError)
  • Optional dependencies via extras: openai, ollama

πŸ“¦ Installation

pip install qdrant-loader-core

With extras:

pip install "qdrant-loader-core[openai]"
pip install "qdrant-loader-core[ollama]"

πŸ“„ Logging

Use built-in structured logging:

from qdrant_loader_core.logging import LoggingConfig

LoggingConfig.setup(level="INFO", format="console", file=None)
logger = LoggingConfig.get_logger(__name__)
logger.info("LLM ready", provider=settings.provider)

πŸ“ Notes

  • Secrets (keys/tokens) are masked in both stdlib and structlog output
  • Noisy third‑party logs are toned down; Qdrant version checks are filtered
  • For MCP integration, set MCP_DISABLE_CONSOLE_LOGGING=true to disable console output

❗ Error Handling

Catch provider-normalized exceptions from qdrant_loader_core.llm.errors:

  • TimeoutError β€” request timed out
  • RateLimitedError β€” rate limit exceeded
  • InvalidRequestError β€” bad parameters or unsupported operation
  • AuthError β€” authentication/authorization failed
  • ServerError β€” transport/server failures

πŸ“š Documentation

πŸ†˜ Support

🀝 Contributing

See CONTRIBUTING - Contribution guidelines, development standards, and pull request process.

πŸ“„ License

This project is licensed under the GNU GPLv3 - see the LICENSE file for details.


Ready to get started? Check out our Quick Start Guide or browse the complete documentation.