انتقل إلى المحتوى

AI-Box Service Dependencies

This document provides a categorized inventory of the Python dependencies required to run the AI-Box service. Understanding these dependencies is critical for security scanning, performance monitoring, and troubleshooting.

Source of Truth

The canonical list of all project dependencies is maintained in the ai-box/pyproject.toml file.


Production Dependencies

These packages are required for the service to run in a production environment.

Core Application & API

Package Version Core Responsibility
fastapi >=0.112 The primary web framework for building the high-performance, asynchronous API.
uvicorn >=0.30 The high-performance ASGI server that runs the FastAPI application.
pydantic >=2.8 Used for all data modeling and validation of API requests and responses.
pydantic-settings >=2.4 Manages loading configuration and secrets from environment variables.

Downstream Service Clients

Package Version Core Responsibility
httpx >=0.27 A modern, asynchronous HTTP client used for making requests to other services like the main API.
opensearch-py >=2.7 The official Python client for communicating with the OpenSearch cluster.

Observability

Package Version Core Responsibility
prometheus-client >=0.20 Exposes Prometheus-compatible metrics via the /metrics endpoint.
**python-json-logger** (optional; not currently used by default logging) >=2.0 Formats log output as structured JSON, enabling easier parsing and analysis in a centralized logging system.

Development & Testing Dependencies

These packages are required for running local tests and CI/CD pipelines. They are defined in the [tool] sections of pyproject.toml.

  • pytest: The core framework for running unit and integration tests.
  • ruff: An extremely fast Python linter and code formatter.
  • black: The uncompromising code formatter to ensure consistent style.
  • mypy: The static type checker for ensuring type safety.

Compatibility Notes

  • CI seeds against OpenSearch 2.14 for smoke tests; keep mapping syntax compatible.

Optional ML Dependencies

  • transformers, torch — required only if enabling S1 hf backend or future rerankers; not needed for default deployments.