stormlog.infer.profile
Active inference profiling runner.
Functions
|
Return the request status for a failure and its HTTP status, if any. |
|
Run an inference profile from a resolved config. |
Classes
|
Profile an OpenAI-compatible chat completions endpoint. |
- class stormlog.infer.profile.InferenceProfiler(config, *, run_id=None, on_warning=None)[source]
Bases:
objectProfile an OpenAI-compatible chat completions endpoint.
- Parameters:
config (ProfileConfig)
run_id (str | None)
on_warning (Callable[[str], None] | None)
- stormlog.infer.profile.classify_failure(exc)[source]
Return the request status for a failure and its HTTP status, if any.
urllib wraps every error from connecting and sending in
URLError. A failure insideconnect(), before any byte of the request was sent, isunreachable: the server never saw the request. A failure while sending, or a reset or close before the response’s status line, isdelivery_unknown: the server may have received it. After the status line the server has answered, so a reset is the answer it gave: anerror(orrejected) with that status. A timeout while waiting for the response, or a read that stalls, istimeout. Redirects are not followed, so a 3xx is anerror.- Parameters:
exc (BaseException)
- Return type:
tuple[str, int | None]
- stormlog.infer.profile.run_profile(config, *, on_warning=None)[source]
Run an inference profile from a resolved config.
- Parameters:
config (ProfileConfig)
on_warning (Callable[[str], None] | None)
- Return type:
dict[str, Any]