mechaharness.inference.base

Inference Strategy: pluggable backends for raw model calls.

Client code depends on InferenceStrategy, not on a specific provider. Concrete strategies adapt OpenAI, Anthropic, LM Studio, vLLM, etc.

class mechaharness.inference.base.InferenceStrategy[source]

Bases: Completer

Strategy interface for talking to an inference engine.

async aclose() → None[source]

Release network resources. Override when the strategy holds a client.

capability_profile() → CapabilityProfile[source]

Declared skills used for cost pricing of this backend.

abstractmethod async complete(request: CompletionRequest) → CompletionResponse[source]

Run a single non-streaming completion.

describe() → dict[str, Any][source]

Machine-readable metadata for CLI/API introspection.

name: str = 'base'
async stream(request: CompletionRequest) → AsyncIterator[str][source]

Optional token stream. Default falls back to a single complete().