Skip to content

Model

Models are the LLM backends that power agent reasoning. Agiwo keeps them behind one streaming-first abstraction.

Every provider implements:

async def arun_stream(
self,
messages: list[dict],
tools: list[dict] | None = None,
) -> AsyncIterator[StreamChunk]:
...

StreamChunk is the normalized delta format that the rest of the runtime consumes.

Public providers include:

  • OpenAIModel
  • OpenAIResponsesModel
  • AnthropicModel
  • DeepseekModel
  • NvidiaModel
  • BedrockAnthropicModel

Compatible endpoints are supported through the model factory.

Use the factory when the model comes from config or user input:

from agiwo.llm import create_model_from_dict
model = create_model_from_dict(
provider="openai-compatible",
model_name="my-model",
params={
"base_url": "https://api.example.com/v1",
"api_key_env_name": "MY_API_KEY",
},
)

Use direct classes when the model is hard-coded in application code:

from agiwo.llm import OpenAIModel
model = OpenAIModel(name="gpt-5.4")

The rest of Agiwo depends on one normalized streaming interface instead of provider-specific response types. That is what makes agent execution, tool calling, scheduler orchestration, and tracing work across providers.