Spaces:
Sleeping
Sleeping
Download open_cortex/runtime/events.py from JeCabrera/open-cortex: direct link, hf CLI and curl.
- Browser
- Download file 796 Bytes
-
https://huggingface.co/spaces/JeCabrera/open-cortex/resolve/main/open_cortex/runtime/events.py
- Command line
-
hf download hf://spaces/JeCabrera/open-cortex/open_cortex/runtime/events.py
-
curl -L -o events.py https://huggingface.co/spaces/JeCabrera/open-cortex/resolve/main/open_cortex/runtime/events.py
796 Bytes
| from dataclasses import dataclass | |
| from typing import Literal | |
| from open_cortex.runtime.metrics import RuntimeSnapshot | |
| RuntimeEventKind = Literal[ | |
| "request_started", | |
| "first_token", | |
| "token", | |
| "request_completed", | |
| ] | |
| class RuntimeEvent: | |
| kind: RuntimeEventKind | |
| text_delta: str | |
| ttft_ms: float | None | |
| snapshot: RuntimeSnapshot | None | |
| generated_tokens: int = 0 | |
| elapsed_ms: float | None = None | |
| live_tps: float | None = None | |
| repetition_detected: bool = False | |
| context_tokens: int | None = None | |
| context_size: int | None = None | |
| working_memory_percent: float | None = None | |
| prompt_tokens: int | None = None | |
| completion_tokens: int | None = None | |
| prompt_tps: float | None = None | |
| decode_tps: float | None = None | |