Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Standalone agent runtime core with neutral LLM types, provider clients, tool loop, and extension protocols.
| Date | Stars |
|---|---|
| 2026-07-31 | 293 |
| 2026-08-11 | 292 |
| 2026-08-20 | 291 |
| 2026-08-25 | 292 |
| 2026-08-29 | 293 |
| 2026-09-03 | 293 |
| 2026-09-07 | 292 |
| 2026-09-12 | 291 |
| 2026-09-17 | 290 |
| 2026-09-20 | 290 |
Today
— stars today
This week
-1 stars this week
This month
-1 stars this month
Momentum
0.0
growth rate 0.00%/day
# agent-runtime
A standalone agent runtime core. The runtime owns the agent loop, neutral LLM
types, provider HTTP clients selected by `LLMConfig`, standard tool/prompt/cache
primitives, collaboration-mode mechanics, hooks, budgets, and context helpers.
Product behavior such as memory, sessions, sandboxing, channels, durable
storage, and brand policy stays outside and is composed around these primitives.
## Why
The loop (request → tool calls → repeat → finalize), context estimation,
iteration budget, collaboration modes, and hooks are stable, reusable logic.
Tying them to a product package, database, or web server makes them
un-reusable. This package stays independent of product applications and speaks neutral
runtime data types at its boundaries.
## Quick start
```python
from agent_runtime import Agent, LLMConfig
agent = Agent(
llm_config=LLMConfig(
api="openai-chat-completions",
model="gpt-4.1-mini",
api_key="...",
base_url="https://api.openai.com/v1",
)
)
result = agent.ask("hi")
print(result.content)
print(result.messages) # list[Message] (neutral conversation model)
```
Only `llm_config` is required for a real model turn. For tests or unusual
providers, `model_client` can still be injected directly.
## Provider-neutral by design
The loop speaks a **neutral model**, never OpenAI/Anthropic dict shapes:
- `Message` / `TextPart` / `ImagePart` / `ToolCallPart` / `ToolResultPart` — the
conversation. `ImagePart` (URL or base64) maps to each provider's image
format. Use `Message.user_with_images(text, [ImagePart(...)])`.
- `LLMRequest` / `LLMResponse` / `LLMStreamEvent` — the model call. `system` is a
top-level field; tool calls carry structured `arguments` (a dict, not a JSON
string); `stop_reason` and `usage` are normalized.
Built-in wire converters (`agent_runtime.llm.openai`,
`agent_runtime.llm.anthropic`) translate between the neutral model and each
provider's on-the-wire format. Runtime-owned HTTP provider clients use these
internally when `Agent` is constructed from `LLMConfig`.
## Injection protocols
| Protocol | What it does | Default |
| --- | --- | --- |
| `ModelClient` | Optional custom/test LLM injection | Built from `LLMConfig` |
| `ToolDispatcher` | Lists tool specs, executes by name | `NoopToolDispatcher` (no tools) |
| `SystemPromptProvider` | Builds the system prompt | `StaticSystemPrompt("")` |
| `CacheStrategy` | Shapes the request / extracts cache usage | `NoopCacheStrategy` |
The product layer supplies tools, prompts, cache strategy, sandbox/tool
implementations, and persistence. It normally supplies `LLMConfig`, not a
provider client.
## Runtime primitives
The runtime provides reusable defaults for common product wiring:
- `ToolRegistry` / `RegistryToolDispatcher` for registering model-callable
local tools.
- `PromptParts` / `PromptProvider` for stable system prompt assembly.
- `PromptCacheStrategy` for provider request shaping and cache usage parsing.
Products can use these directly or swap in protocol-compatible alternatives.
## Collaboration modes
The kernel ships the *mechanism*, not the policy. A `CollaborationMode` is a data
structure (name + developer instructions + blocked tool names + blocked effect
classes). The kernel checks tool permission and injects the mode's instructions;
it defines no concrete modes and hard-codes no tool names.
```python
from agent_runtime import Agent, CollaborationMode
plan_mode = CollaborationMode(
name="plan",
developer_instructions="Plan only. Do not mutate state.",
blocked_tools=frozenset({"write_file"}),
blocked_effects=frozenset({"repo_mutating"}),
)
agent = Agent(llm_config=..., collaboration_mode=plan_mode)
```
## Hooks
`AgentHooks` is the lifecycle extension point: `on_messages_initialized`,
`before_model_request`, `after_model_response`, `before_tool_call`,
`after_tool_call`, `after_turn`. Compose several with `CompositeAgentHooks`.
The product uses hooks for conExcerpt of 6,765 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:352cf4e05fea6553, llm:repository description: 'Standalone agent runtime core with neutral LLM types, provider clients, tool loop, and extension protocols.' language: Python
matched fp:352cf4e05fea6553, llm:repository description: 'Standalone agent runtime core with neutral LLM types, provider clients, tool loop, and extension protocols.' language: Python
matched fp:352cf4e05fea6553, llm:repository description: 'Standalone agent runtime core with neutral LLM types, provider clients, tool loop, and extension protocols.' language: Python