best_engine_ai_helper.api module
api — FastAPI HTTP surface for best-engine-ai-helper.
Exposes the two calls the GUI needs:
GET /api/system— detected hardware + compute profile + memory budget.POST /api/recommend— a free-text task -> the same reportrecommend()produces for the CLI’sreportcommand, as JSON.
A minimal single-page GUI is served at GET /gui (GET / redirects
there): it shows the machine’s characteristics and lets you type a task
description to get the best local engine(s) for it. It is bilingual —
French by default, English at GET /gui?lang=en — with a header link to
switch between the two.
Install the extra to get the runtime dependencies:
pip install 'best-engine-ai-helper[api]'
Then run the app with any ASGI server:
uvicorn best_engine_ai_helper.api:app --port 8000
# or: best-engine-ai-helper gui
- class best_engine_ai_helper.api.RecommendRequest(*, task=None, headroom=0.85)[source]
Bases:
BaseModelBody for
POST /api/recommend.- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- best_engine_ai_helper.api.recommend(body)
Best local engine(s) for
body.taskon this machine’s hardware.- Parameters:
body (RecommendRequest)
- Return type:
- best_engine_ai_helper.api.root()
- Return type:
fastapi.responses.RedirectResponse