Metadata-Version: 2.4
Name: crewai-pathcourse
Version: 0.1.0
Summary: CrewAI integration for PathCourse Health — autonomous agent inference with USDC billing on Base L2
Project-URL: Homepage, https://pathcoursehealth.com
Project-URL: Repository, https://github.com/pathcourse-health/crewai-pathcourse
Project-URL: Documentation, https://docs.pathcoursehealth.com
License: MIT
Keywords: ai-agents,autonomous,crewai,llm,multi-agent,pathcourse
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: crewai>=0.70.0
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: python-dotenv; extra == 'dev'
Description-Content-Type: text/markdown

# crewai-pathcourse

CrewAI integration for PathCourse Health. Give your CrewAI agents autonomous USDC billing on
Base L2 — no accounts, no credit cards, no KYC.

## Install

```bash
pip install crewai-pathcourse
```

## Quick Start

```python
import os
from crewai import Agent, Crew, Task
from crewai_pathcourse import PathCourseLLM

# Set PCH_API_KEY in your environment
llm = PathCourseLLM(model="pch-pro")

researcher = Agent(
    role="Research Analyst",
    goal="Find the best AI agent infrastructure for autonomous operation",
    backstory="You are an expert in autonomous agent systems.",
    llm=llm,
    verbose=True,
)

writer = Agent(
    role="Technical Writer",
    goal="Write a clear technical comparison",
    backstory="You write precise technical documentation.",
    llm=PathCourseLLM(model="pch-fast"),  # cheaper model for writing
    verbose=True,
)

research_task = Task(
    description="Research the key requirements for autonomous agent infrastructure.",
    expected_output="A bullet list of 5 key infrastructure requirements.",
    agent=researcher,
)

write_task = Task(
    description="Write a 200-word summary of the research findings.",
    expected_output="A 200-word technical summary.",
    agent=writer,
)

crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
result = crew.kickoff()
print(result)
```

## Per-agent model selection

Different agents in a crew can use different PCH models. Use cheaper models for simple tasks
and reserve `pch-pro` or `claude-sonnet` for agents doing deep reasoning.

```python
from crewai_pathcourse import PathCourseLLM

planner    = Agent(..., llm=PathCourseLLM(model="pch-pro"))
researcher = Agent(..., llm=PathCourseLLM(model="pch-fast"))
coder      = Agent(..., llm=PathCourseLLM(model="pch-coder"))
```

## Models

| Model | Rate | Notes |
|---|---|---|
| `pch-fast` | $0.44/M tokens | Fast reasoning, classification, routing |
| `pch-pro` | $1.96/M tokens | Deep reasoning, multi-step planning (Bronze+) |
| `pch-coder` | $3.50/M tokens | Code generation, debugging |
| `claude-haiku` | Common rate | Third-party balanced model (Silver+) |
| `claude-sonnet` | Common rate | Third-party long-context model (Gold) |

Choosing a model:

- Fast response, simple task → `pch-fast`
- Complex reasoning, multi-step → `pch-pro`
- Writing or reviewing code → `pch-coder`

## Authentication

Set `PCH_API_KEY` in your environment, or pass `pch_api_key=` to `PathCourseLLM`.

```bash
export PCH_API_KEY=pch_prod_b_...
```

Get an API key at [pathcoursehealth.com](https://pathcoursehealth.com).

## How it works

CrewAI uses [LiteLLM](https://github.com/BerriAI/litellm) internally for model calls. PCH is
fully OpenAI API-compatible, so `PathCourseLLM` just configures CrewAI's standard `LLM` class
with the PCH gateway URL and your API key. Every CrewAI feature (tools, memory, hierarchical
crews, async execution) works unchanged.

## Links

- Platform: [pathcoursehealth.com](https://pathcoursehealth.com)
- CrewAI: [crewai.com](https://www.crewai.com)
- Python SDK: [pypi.org/project/pathcourse-sdk](https://pypi.org/project/pathcourse-sdk/)
- Integration examples: [github.com/pathcourse-health/pch-integration-examples](https://github.com/pathcourse-health/pch-integration-examples)

## License

MIT
