backend
backend
¶
Abstract base class for inference backends.
Classes¶
InferenceBackend
¶
Bases: ABC
Base class for all inference backends used in evaluation.
Functions¶
generate
abstractmethod
¶
generate(prompt: str, *, model: str, system: str = '', temperature: float = 0.0, max_tokens: int = 2048) -> str
Generate a response and return just the text content.
generate_full
abstractmethod
¶
generate_full(prompt: str, *, model: str, system: str = '', temperature: float = 0.0, max_tokens: int = 2048) -> Dict[str, Any]
Generate a response and return full details.
Returns dict with keys: content, usage, model, latency_seconds, cost_usd.