MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / list_models

Function list_models

examples/server/server.py:16316–16329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16314
16315 @app.get("/v1/models", response_model=ModelListResponse)
16316 async def list_models() -> ModelListResponse: # pyright: ignore[reportUnusedFunction]
16317 service = app.state.service
16318 model = service.scheduler.model
16319 model_id = getattr(model, "model_alias", None) or model.model_path
16320 created = int(time.time())
16321 return ModelListResponse(
16322 data=[
16323 ModelCardResponse(
16324 id=model_id,
16325 created=created,
16326 owned_by="llama-cpp-python",
16327 )
16328 ]
16329 )
16330
16331 @app.get("/healthz", response_model=HealthzResponse)
16332 async def healthz() -> HealthzResponse: # pyright: ignore[reportUnusedFunction]

Callers

nothing calls this directly

Calls 2

ModelListResponseClass · 0.85
ModelCardResponseClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…