from pathlib import Path import toml from fastapi import APIRouter router = APIRouter() @router.get("/") async def root(): version = "dev" pyproject = Path(__file__).resolve().parent.parent.parent / "pyproject.toml" if pyproject.exists(): try: data = toml.load(pyproject) version = data.get("project", {}).get("version", "dev") except Exception: pass return {"status": "ok", "msg": "LLM-infa API", "version": version}