Tactics
Tactic is LLLM's center model. A tactic is a small, typed, service-ready unit
that does one thing well.
Tactics provide:
- input and output type metadata,
- local
runand asyncaruncalls, - optional streaming,
CallContextrequest metadata,TacticInfofor services, package cards, and agent instructions.
from lllm import Tactic
class EchoTactic(Tactic[EchoInput, EchoOutput]):
name = "echo"
input_type = EchoInput
output_type = EchoOutput
def _run(self, input_value, *, context=None):
return EchoOutput(text=input_value.text.upper())
The protocol stays runtime-agnostic. A tactic can hide a Pydantic AI agent, plain Python function, native prompt/dialog workflow, or remote service.