falaw.liveness#
Is a catalogued endpoint still deployed? (falaw#76)
fal retires endpoints without notice (fal-ai/imagen4/preview/ultra answers
404 Application "imagen4" not found), and pick_model would keep
picking them. fal’s OpenAPI endpoint answers 404 for a dead id and 200 for a
live one without a billed call or an API key, so one GET per id is a free
liveness probe.
Module Attributes
|
|
|
Functions
|
|
|
The ids from |
- falaw.liveness.OPENAPI_URL = 'https://fal.ai/api/openapi/queue/openapi.json'#
?endpoint_id=<id>selects the endpoint.
- falaw.liveness.StatusGetter#
url -> HTTP status; injectable so tests never touch the network.
- falaw.liveness.check_model_liveness(ids=None, *, status_of=None)[source]#
{endpoint_id: is_live}forids(default: every catalogued model).Only a 404 means dead; any other non-200 answer (rate limit, fal outage) raises rather than report a live model as dead, which would get it deleted.
- falaw.liveness.dead_models(ids=None, *, status_of=None)[source]#
The ids from
check_model_liveness()that are no longer deployed.