#!/usr/bin/env python3 """Main entry point for the KYB Tech Dots.OCR application. Provides a callable ``main()`` for console_scripts and direct execution. """ import os import uvicorn from src.kybtech_dots_ocr.app import app def main() -> None: """Start the FastAPI server with sensible defaults. This function is exposed as a console script via pyproject.toml. Set DOTS_OCR_SKIP_MODEL_LOAD=1 to skip heavy model download for local testing. """ # Respect environment overrides for host/port host = os.getenv("HOST", "0.0.0.0") port = int(os.getenv("PORT", "7860")) log_level = os.getenv("LOG_LEVEL", "info") uvicorn.run(app, host=host, port=port, log_level=log_level) if __name__ == "__main__": main()