Skip to content

Errors

One error family for the library and the web API.

errors

Errors raised by LLMDyno's services and Python API.

Every error carries the HTTP status the web API answers with, so the same exception means the same thing whether you call llmdyno.bench() from Python or POST /api/plans: one handler in server.py turns it into {"detail": message}. All of them inherit from LLMDynoError; catch that to handle anything LLMDyno refuses or fails to do.

LLMDynoError

Bases: Exception

Anything LLMDyno refuses or fails to do; the message says why and usually what to change.

InvalidError

Bases: LLMDynoError, ValueError

A request that cannot be valid as given (bad setting, missing field, unknown option).

ForbiddenError

Bases: LLMDynoError, PermissionError

Not allowed, for example editing a built-in benchmark or suite.

NotFoundError

Bases: LLMDynoError, LookupError

No such profile, model, plan, run, benchmark, file, …

ConflictError

Bases: LLMDynoError

The thing is in use, already exists, ambiguous, or in the wrong state for this action.

RiskNotAcknowledgedError

Bases: InvalidError

A plan has danger warnings (VRAM spill, out of memory, …) that need acknowledge_risks=True.

RateLimitError

Bases: LLMDynoError

An upstream rate limit, for example the Artificial Analysis free tier's 100 requests a day.

UpstreamError

Bases: LLMDynoError

An external service failed (Hugging Face, a provider API, Artificial Analysis, …).

InsufficientStorageError

Bases: LLMDynoError

Not enough disk space, for example for a model download.

PreflightError

PreflightError(problems: Iterable[str], warnings: Iterable[str] | None = None, report: dict[str, Any] | None = None)

Bases: LLMDynoError

A plan cannot start. problems are the blocking items, warnings the rest of the preflight report.

from_exception

from_exception(exc: BaseException) -> LLMDynoError | None

The LLMDyno error for an exception raised inside the engine, with the HTTP status the web API has always answered with (KeyError 404, ValueError 400, PermissionError 403, FileExistsError 409, FileNotFoundError 400, ConnectionError 502, RuntimeError 400); None for anything else (a bug, which should surface as is).

http

http(status: int, detail: object) -> LLMDynoError

The error class for an HTTP status, with that message (services use this where the web API used HTTPException, so status codes and messages stay exactly as they were).