Metadata-Version: 2.4
Name: agentdeploy
Version: 0.2.0
Summary: Zero-boilerplate deployment for AI agent frameworks — LangGraph, CrewAI, OpenAI Agents SDK, and custom agents
Project-URL: Homepage, https://github.com/erenat77/agentdeploy
Project-URL: Repository, https://github.com/erenat77/agentdeploy
Project-URL: Issues, https://github.com/erenat77/agentdeploy/issues
Project-URL: Documentation, https://github.com/erenat77/agentdeploy#readme
Project-URL: Changelog, https://github.com/erenat77/agentdeploy/blob/main/CHANGELOG.md
Author: Aaron
License: MIT
License-File: LICENSE
Keywords: agents,ai,crewai,deployment,docker,kubernetes,langgraph
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: jinja2>=3.1
Requires-Dist: langgraph>=1.1.10
Requires-Dist: opentelemetry-api>=1.20
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.20
Requires-Dist: opentelemetry-sdk>=1.20
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.12
Provides-Extra: all
Requires-Dist: anthropic>=0.34; extra == 'all'
Requires-Dist: boto3>=1.34; extra == 'all'
Requires-Dist: build>=1.2; extra == 'all'
Requires-Dist: crewai>=0.70; extra == 'all'
Requires-Dist: google-cloud-run>=0.10; extra == 'all'
Requires-Dist: kubernetes>=28.1; extra == 'all'
Requires-Dist: langgraph>=0.2; extra == 'all'
Requires-Dist: mypy>=1.10; extra == 'all'
Requires-Dist: openai>=1.50; extra == 'all'
Requires-Dist: pre-commit>=3.7; extra == 'all'
Requires-Dist: pytest-asyncio>=0.23; extra == 'all'
Requires-Dist: pytest-cov>=5.0; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: ruff>=0.4; extra == 'all'
Requires-Dist: twine>=5.0; extra == 'all'
Provides-Extra: aws
Requires-Dist: boto3>=1.34; extra == 'aws'
Provides-Extra: claude
Requires-Dist: anthropic>=0.34; extra == 'claude'
Provides-Extra: crewai
Requires-Dist: crewai>=0.70; extra == 'crewai'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Provides-Extra: gcp
Requires-Dist: google-cloud-run>=0.10; extra == 'gcp'
Provides-Extra: k8s
Requires-Dist: kubernetes>=28.1; extra == 'k8s'
Provides-Extra: langgraph
Requires-Dist: langgraph>=0.2; extra == 'langgraph'
Provides-Extra: openai
Requires-Dist: openai>=1.50; extra == 'openai'
Description-Content-Type: text/markdown

# AgentDeploy

[![CI](https://github.com/erenat77/agentdeploy/actions/workflows/ci.yml/badge.svg)](https://github.com/erenat77/agentdeploy/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/agentdeploy.svg)](https://pypi.org/project/agentdeploy/)
[![Python](https://img.shields.io/pypi/pyversions/agentdeploy.svg)](https://pypi.org/project/agentdeploy/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

**Zero-boilerplate deployment for AI agent frameworks.**

Take any LangGraph, CrewAI, OpenAI Agents SDK, or custom agent and generate production-ready Kubernetes manifests, Docker Compose files, Lambda handlers, or Cloud Run services — in under 10 lines of Python.

---

## The problem it solves

Every team building AI agents in 2025–2026 faces the same 3–6 week detour:

- Write the agent (30 min)
- Figure out how to containerise it (1 day)
- Write Kubernetes manifests with correct resource limits, health checks, and HPA (2 days)
- Add human-in-the-loop gates (1 week)
- Wire up OpenTelemetry tracing and cost tracking (3 days)
- Repeat for every new agent

AgentDeploy collapses this to a single fluent call.

---

## Install

```bash
# pip
pip install agentdeploy

# uv (recommended)
uv add agentdeploy

# With framework extras:
uv add "agentdeploy[langgraph]"
uv add "agentdeploy[crewai]"
uv add "agentdeploy[openai]"
uv add "agentdeploy[all]"
```

---

## Quick start

```python
from agentdeploy import AgentApp, deploy

# 1. Wrap your existing agent (framework auto-detected)
app = (
    AgentApp("my-agent", description="Summarisation agent")
    .wrap(my_langgraph_graph)               # or CrewAI Crew, OpenAI Agent, callable
    .env("ANTHROPIC_API_KEY", from_secret="anthropic-key")
    .resources(memory_mb=2048, timeout_seconds=120)
)

# 2. Generate Kubernetes manifests + Dockerfile
result = (
    deploy(app)
    .to_kubernetes(namespace="agents", image="my-agent:0.1.0")
    .with_replicas(2)
    .with_autoscale(min=1, max=10, cpu_percent=60)
    .with_hitl_gate(webhook="https://yourapp.com/api/approve")
    .with_telemetry(endpoint="http://otel-collector:4317")
    .build()
)

print(result)
# → Dockerfile, deployment.yaml, service.yaml, hpa.yaml, secret.yaml
# → kubectl apply -k ./deploy/my-agent/k8s/
```

---

## Supported frameworks

| Framework | Detection | Adapter |
|---|---|---|
| LangGraph | `CompiledStateGraph` type | `_LangGraphAdapter` |
| CrewAI | `crewai` module, `Crew` type | `_CrewAIAdapter` |
| OpenAI Agents SDK | `openai.agents` module | `_OpenAIAgentAdapter` |
| Any `async callable` | fallback | `_CallableAdapter` |

Custom framework? Register your own adapter:

```python
from agentdeploy.adapters import AdapterRegistry, AgentAdapter

class MyAdapter(AgentAdapter):
    framework_name = "my-framework"
    def validate(self): ...
    def pip_extras(self): return ["my-framework>=1.0"]
    def entrypoint_code(self, app_name, port): return "..."

AdapterRegistry.register("my-framework", MyAdapter)
```

---

## Deploy targets

### Kubernetes
```python
deploy(app).to_kubernetes(namespace="prod", image="myimg:1.0")
    .with_replicas(3)
    .with_autoscale(min=1, max=20, cpu_percent=70)
    .with_hitl_gate(webhook="https://yourapp.com/approve")
    .with_telemetry(endpoint="http://otel-collector:4317")
    .build()
```
Generates: `Dockerfile`, `deployment.yaml`, `service.yaml`, `hpa.yaml`, `secret.yaml`, `kustomization.yaml`

### Docker Compose (local / staging)
```python
deploy(app).to_docker_compose()
    .with_redis()
    .with_otel_collector()
    .build()
# → docker compose up --build
```

### AWS Lambda
```python
deploy(app).to_lambda(region="us-east-1", function_name="my-agent")
    .build()
# → sam build && sam deploy
```

### Google Cloud Run
```python
deploy(app).to_cloud_run(project="my-gcp-project", region="us-central1")
    .with_scaling(min_instances=0, max_instances=20)
    .build()
# → gcloud builds submit && gcloud run services replace ...
```

---

## Human-in-the-Loop (HITL)

Add human oversight at any decision point:

```python
from agentdeploy import HITLGate, HITLDecision

gate = HITLGate(webhook="https://yourapp.com/api/approve")

async def run_agent(user_input):
    state = await my_agent.ainvoke(user_input)

    approval = await gate.checkpoint(
        state=state,
        description="Agent about to write to production database",
    )

    if approval.decision == HITLDecision.REJECT:
        return {"status": "cancelled", "reason": approval.reason}

    return approval.modified_state or state
```

Your webhook endpoint resolves the checkpoint:
```python
from agentdeploy import HITLGate, HITLDecision, CheckpointResult

@app.post("/api/approve/{checkpoint_id}")
async def approve(checkpoint_id: str):
    await gate.resolve(checkpoint_id, CheckpointResult(
        decision=HITLDecision.APPROVE,
        reviewer="alice@company.com",
    ))
```

Delivery channels: `webhook=`, `slack_webhook=`, `console_fallback=True` (local dev)

---

## Telemetry

```python
from agentdeploy import Telemetry

telemetry = Telemetry("my-agent", otel_endpoint="http://otel-collector:4317")

async with telemetry.trace("invoke", input=user_input) as span:
    result = await my_agent.ainvoke(user_input)
    span.set_tokens(prompt=512, completion=128, model="claude-sonnet-4-6")
    # → auto-calculates cost, writes span to OTel collector
```

Built-in cost estimation for: `gpt-4o`, `gpt-4o-mini`, `claude-sonnet-4-6`, `claude-opus-4-6`, `gemini-1.5-pro`

---

## CLI

```bash
# Scaffold a new project
agentdeploy init my-agent --framework langgraph --target kubernetes

# Validate config without building
agentdeploy validate

# Build artifacts
agentdeploy build --output ./deploy

# Dry run
agentdeploy build --dry-run
```

---

## Project layout (generated)

```
deploy/
└── my-agent/
    ├── Dockerfile
    ├── server.py          # auto-generated FastAPI entrypoint
    └── k8s/
        ├── deployment.yaml
        ├── service.yaml
        ├── hpa.yaml
        ├── secret.yaml    # placeholder — fill in before applying
        └── kustomization.yaml
```

Apply to cluster:
```bash
kubectl apply -k ./deploy/my-agent/k8s/
kubectl rollout status deployment/my-agent -n agents
```

---

## Roadmap

- [ ] v0.2 — Helm chart output target
- [ ] v0.2 — Multi-agent topology (one app, N agent pods with message bus wiring)
- [ ] v0.3 — Budget enforcement middleware (per-run token caps)
- [ ] v0.3 — Replay debugger (capture + replay full execution traces)
- [ ] v0.4 — Pulumi / Terraform IaC output
- [ ] v0.5 — GitHub Actions / GitLab CI pipeline generation

---

## Contributing

```bash
git clone https://github.com/erenat77/agentdeploy
cd agentdeploy
uv pip install -e ".[dev]"   # or: pip install -e ".[dev]"
pre-commit install
pytest tests/ -v
```

PRs welcome. Please add tests for new adapters and targets.

---

## License

MIT
