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 Min tier Notes
pch-fast $0.44 / M tokens uncertified Fast reasoning, classification, routing
pch-coder $3.50 / M tokens uncertified Code generation, debugging
pch-embed $0.015 / M tokens uncertified Text embeddings for semantic search / RAG
pch-translate $0.08 / M chars uncertified Multilingual translation
pch-pro $1.96 / M tokens bronze Deep reasoning, multi-step planning
pch-audio $1.85 / M chars bronze Text-to-speech, standard quality
pch-documents $0.26 in / $1.48 out per M tokens bronze Document parsing / OCR
pch-transcribe $0.0008 / minute bronze Speech-to-text
pch-extract $0.012 / M tokens bronze Structured data extraction
pch-rerank $0.025 / M tokens bronze Reranking for RAG pipelines
pch-image $0.028 / image silver Text-to-image
pch-audio-premium $37.00 / M chars silver Text-to-speech, premium quality
pch-talk $0.001 / minute silver Voice conversation
claude-haiku Common rate silver Anthropic Claude Haiku
claude-sonnet Common rate gold Anthropic Claude Sonnet

pch_config only operates on chat-completion shapes — for image/audio/transcription, use the PCH Python SDK directly.

Choosing a chat model:

  • Fast response, simple task → pch-fast
  • Complex reasoning, multi-step → pch-pro
  • Writing or reviewing code → pch-coder
  • Long context or premium reasoning → claude-sonnet (Gold tier)

Authentication

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

export PCH_API_KEY=pch_prod_b_...

Developer access — $5 USDC. Send $5+ USDC on Base (chain ID 8453) to the PCH treasury wallet, then call pathcourse.claim_key(tx_hash, wallet) to retrieve your key. No accounts, no credit card, no KYC. $5 buys thousands of pch-fast calls — enough to verify any AutoGen group chat. Top up to $25 lifetime and your account auto-upgrades to Uncertified with pch-coder access. Treasury address: see payment.treasury_wallet in /.well-known/agent.json.

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.2.tar.gz (3.6 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.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autogen_pathcourse-0.1.2.tar.gz
  • Upload date:
  • Size: 3.6 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.2.tar.gz
Algorithm Hash digest
SHA256 92335ae931ca35ce69cb01bc764d315081613eb9a11280c4b4fcfd4c21aea1fb
MD5 7635a44552704652394ef61c3486b281
BLAKE2b-256 aefd84742c3c095a61808a9ffa61a1b71a7d2189c7bb5cbe6ea5db019a496719

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for autogen_pathcourse-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6680268038e07c67c0b459c5b768071383fb63762bf5b4e3fc88214b4fd8c5ab
MD5 d3674b6c9dd6ae74b6db5899599f5b1e
BLAKE2b-256 868b4420bba0c2c9d8982b0799e3f5a49336e2dd887cde9d59c652be3697d425

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