Metadata-Version: 2.5
Name: ampup-harness
Version: 0.2.0
Summary: AmpUp Harness Python SDK, with adapters that run Agno and the Claude Agent SDK on the harness by changing imports
Author: AmpUp
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,agno,ampup,harness,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: agno
Requires-Dist: agno>=3.0; extra == 'agno'
Requires-Dist: anthropic>=0.50; extra == 'agno'
Requires-Dist: openai>=1.0; extra == 'agno'
Provides-Extra: claude-agent-sdk
Requires-Dist: claude-agent-sdk>=0.1; extra == 'claude-agent-sdk'
Description-Content-Type: text/markdown

# ampup-harness

Python SDK for AmpUp Harness. Python 3.10+. The core SDK is standard library only; the Agno and
Claude Agent SDK adapters are optional extras.

```sh
uv add ampup-harness
```

Point it at a harness with environment variables:

```sh
export AMPUP_HARNESS_URL=https://harness.example.com
export AMPUP_HARNESS_API_KEY=...
```

## Agno adapter (`ampup_harness.agno`)

Code written for [Agno](https://github.com/agno-agi/agno) runs on the harness after changing
`from agno.` to `from ampup_harness.agno.` in its imports. It is **your installed Agno**, unmodified,
with one change: every model call goes to the harness gateway, which meters spend per key and
serves any OpenRouter model.

```sh
uv add 'ampup-harness[agno]'      # ampup-harness + agno + the OpenAI and Anthropic SDKs
export AMPUP_HARNESS_URL=https://harness.example.com
export AMPUP_HARNESS_API_KEY=...
```

```python
from ampup_harness.agno.agent import Agent
from ampup_harness.agno.models.openai import OpenAIChat
from ampup_harness.agno.team import Team

agent = Agent(model=OpenAIChat(id="gpt-5"), instructions="Be terse.", markdown=True)
agent.print_response("Share a two-line story.", stream=True)
```

- Agents, teams, workflows, tools and Agno's prebuilt toolkits, knowledge, memory, storage,
  structured outputs and streaming are Agno's own code, at the version you installed.
- `Claude` calls the harness's Anthropic-compatible `/v1/messages`; `OpenAIChat` and every
  `OpenAILike` model (OpenRouter, DeepSeek, xAI, …) call its OpenAI-compatible `/v1/chat/completions`.
  Other providers (Gemini, Groq, Mistral, Ollama, Bedrock, Azure, …) are rebuilt as harness-routed
  `OpenAIChat` models, with a warning. Model ids become OpenRouter slugs (`gpt-5` → `openai/gpt-5`).
- `Agent` and `Team` also route string models (`"openai:gpt-5"`), Agno's default model, fallback
  models, and models built from `agno.` imports. Agno's own modules are left unchanged, so code
  that imports `agno.` directly in the same process still calls the providers.

## Claude Agent SDK adapter (`ampup_harness.claude_agent_sdk`)

Code written for Anthropic's [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-python)
runs on the harness after changing `claude_agent_sdk` to `ampup_harness.claude_agent_sdk` in its
imports. It is your installed SDK, unmodified; `query` and `ClaudeSDKClient` start its Claude Code
CLI with the model endpoint set to the harness gateway.

```sh
uv add 'ampup-harness[claude-agent-sdk]'
export AMPUP_HARNESS_URL=https://harness.example.com
export AMPUP_HARNESS_API_KEY=...   # a user key with a gateway daily budget; the agent's tools can read it
```

```python
from ampup_harness.claude_agent_sdk import ClaudeAgentOptions, query

async for message in query(prompt="Fix the failing test", options=ClaudeAgentOptions(model="sonnet")):
    print(message)
```

Built-in tools, hooks, permissions, MCP servers, subagents and sessions are the SDK's own. Claude
ids become OpenRouter slugs (`claude-sonnet-5-5` → `anthropic/claude-sonnet-5.5`), the aliases
`sonnet`/`opus`/`haiku`/`fable` map to current models (override with `AMPUP_HARNESS_MODEL_<ALIAS>`),
and any slug works, including non-Claude models (`openai/gpt-5`).
See [docs/claude-agent-sdk-compat.md](https://github.com/A79-ai/ampup-harness/blob/main/docs/claude-agent-sdk-compat.md).

## Agno's API without Agno (`ampup_harness.agno_lite`)

`ampup_harness.agno_lite` reimplements the most used parts of Agno's API with no dependencies, and
can run agents server-side as harness agent templates (sessions, memory blocks and harness tools
live on the harness). It covers less than the adapter: no `Team`, knowledge, structured outputs or
prebuilt toolkits. See [docs/agno-compat.md](https://github.com/A79-ai/ampup-harness/blob/main/docs/agno-compat.md).

## Low-level client

```python
from ampup_harness import HarnessConfig, HarnessError

config = HarnessConfig.from_env()  # AMPUP_HARNESS_URL, AMPUP_HARNESS_API_KEY
```

Use HTTPS beyond trusted loopback. Credentials stay in headers, redirects are refused, and URLs
carrying credentials, a query or a fragment are rejected.

License: Apache-2.0.
