Skip to main content

AutoGen / AG2 integration for PathCourse Health — multi-agent inference with autonomous USDC billing on Base L2

Project description

autogen-pathcourse

AutoGen / AG2 integration for PathCourse Health. Run multi-agent conversations with autonomous USDC billing on Base L2 — no accounts, no credit cards, no KYC.

Install

# AutoGen (legacy package name)
pip install autogen-pathcourse pyautogen

# AG2 (the new fork)
pip install autogen-pathcourse ag2

Quick Start

from autogen import AssistantAgent, UserProxyAgent
from autogen_pathcourse import pch_config

config_list = pch_config(model="pch-pro")
llm_config = {"config_list": config_list, "temperature": 0.7}

assistant = AssistantAgent(
    name="assistant",
    llm_config=llm_config,
    system_message="You are a helpful AI assistant.",
)

user_proxy = UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=3,
    code_execution_config=False,
)

user_proxy.initiate_chat(assistant, message="Explain x402 in two sentences.")

Mixed-model multi-agent setup

Use different PCH models for different agents in the same conversation:

from autogen import AssistantAgent
from autogen_pathcourse import pch_config

planner = AssistantAgent(
    name="planner",
    llm_config={"config_list": pch_config(model="pch-pro")},
    system_message="You plan multi-step research.",
)

coder = AssistantAgent(
    name="coder",
    llm_config={"config_list": pch_config(model="pch-coder")},
    system_message="You implement what the planner specifies.",
)

reviewer = AssistantAgent(
    name="reviewer",
    llm_config={"config_list": pch_config(model="pch-fast")},
    system_message="You spot-check work for issues.",
)

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 pch_config.

export PCH_API_KEY=pch_prod_b_...

Get an API key at pathcoursehealth.com.

How it works

AutoGen's config_list accepts any OpenAI-compatible endpoint via the base_url and api_type: "openai" fields. The PCH gateway is fully OpenAI API-compatible, so this adapter is purely configuration — every AutoGen feature (group chat, code execution, function calling, custom agents) 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

autogen_pathcourse-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

autogen_pathcourse-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for autogen_pathcourse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 484ba128c8a5d0e14b9bbf5015f58bb655863ba48bfa40c0555f0fb66d365ff5
MD5 78a63ea2bb51d09ee92ba5ea22d01753
BLAKE2b-256 d26dd4487e5bcc3b392fce78d15e7b2222dd9d1df8a92bcdc0db5194bff7a783

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for autogen_pathcourse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50fdb2c30400a0a7e163559c99e67da1d0f782f59685586ac72608b1622ceda4
MD5 6bd33896d742f1a65c9c55982cd97289
BLAKE2b-256 fd85701797955d2bf28a4cbe3ab50abdaa5771950bd6b844fea329e70610b51a

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