Skip to main content

CrewAI integration for PathCourse Health — autonomous agent inference with USDC billing on Base L2

Project description

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

pip install crewai-pathcourse

Quick Start

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.

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.

export PCH_API_KEY=pch_prod_b_...

Get an API key at pathcoursehealth.com.

How it works

CrewAI uses 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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crewai_pathcourse-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crewai_pathcourse-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file crewai_pathcourse-0.1.0.tar.gz.

File metadata

  • Download URL: crewai_pathcourse-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for crewai_pathcourse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c372bc52d71bab507879081da7365d2607cd300ca10351f5f7198aa745f35ee0
MD5 f4194ef65c80fae0779fd5b83ddb5f18
BLAKE2b-256 25fd0e546d10a5422e448bd82f1c0eb581c9131a6c34d0f7ad5551322730439e

See more details on using hashes here.

File details

Details for the file crewai_pathcourse-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crewai_pathcourse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea1c625b35ae47c161a358d4af7b5d3d961f02fa6bf1e15fcdce256f00a38672
MD5 ed41fcbd83dd31a4fbd16f189c6a7d48
BLAKE2b-256 1213a1b1dc1c12ffa8e7b200af8a94d938ffdad785d1eb6233122c825ed4ed64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page