app
FastAPI application factory with lifespan management and CORS configuration.
AIHordeStatus
Bases: BaseModel
Status of the external AI Horde API connection.
Source code in src/horde_model_reference/service/app.py
HeartbeatResponse
Bases: BaseModel
Enhanced heartbeat response with external service status.
Source code in src/horde_model_reference/service/app.py
lifespan
async
Manage application lifespan events.
Starts background cache hydration on startup and stops it on shutdown.
Source code in src/horde_model_reference/service/app.py
read_root
async
Root endpoint for the Horde Model Reference API1.
Source code in src/horde_model_reference/service/app.py
heartbeat
async
Heartbeat endpoint to check the service status.
Returns overall service status and the state of the external AI Horde API
connection. When the AI Horde API is unreachable, ai_horde.degraded is
True and ai_horde.seconds_until_retry indicates when the next probe
request will be attempted.
Source code in src/horde_model_reference/service/app.py
replicate_mode
async
Get backend configuration and capabilities.
Returns information about the backend's replication mode, canonical format, and whether write operations are supported.
Clients should use this endpoint on startup to determine: - Whether the backend supports write operations (writable=True) - Which API version to use for CRUD operations (based on canonical_format)
Note: For backward compatibility, this endpoint path is retained but now returns a richer BackendInfo response instead of just the ReplicateMode.