Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

agenthub

> AI 编程
Open source

AgentHub SDK is the unified and transparent multi-LLM SDK for building reliable Agent Apps. (GPT-5.5/Claude 5/Gemini 3.6)

100 stars0 likes3 views
WebsiteGitHub

About

AgentHub SDK is the unified and transparent multi-LLM SDK for building reliable Agent Apps. (GPT-5.5/Claude 5/Gemini 3.6)

AgentHub SDK - Unified and Precise LLM SDK

AgentHub is the LLM API Hub for the Agent era, built for high-precision autonomous agents.

Using a coding agent? Install the AgentHub SKILL files from skills/ so it can use AgentHub correctly in generated code.

Follow us on X: or join our Discord Community

Why AgentHub?

  • Unified: A consistent and intuitive interface for developing agents across different LLMs.

  • Precise: Automatically handles interleaved thinking during multi-step tool calls, preventing performance degradation.

  • Traceable: Provides lightweight yet fine-grained tracing for debugging and auditing LLM executions.

Features

AutoLLMClient (Python & TypeScript)

Switch different LLMs with zero code changes and no performance loss.

Built-in Observability

Audit LLM executions by adding a single trace_id parameter, no database required.

https://github.com/user-attachments/assets/c49a21a1-5bf9-4768-a76d-f73c9a03ca87

Supported Models

Model Name Vendor Example Model ID Input Modalities Output Modalities
Gemini 3-3.8 Official/Google Vertex AI gemini-3.8-flash Text, Image Text, Image, Speech, Embedding
Claude 4.6-5 Official/Amazon Bedrock/UModelVerse claude-opus-5 Text, Image Text
GPT-5.4-6 Official/OpenRouter/UModelVerse gpt-6-astra Text, Image Text, Embedding
Kimi-K2.5/K2.6/K3 Official/OpenRouter/SiliconFlow kimi-k3 Text, Image Text
DeepSeek V4 Official/OpenRouter/SiliconFlow deepseek-v4-pro Text, Image Text
GLM-5.1-5.3 Official/OpenRouter/SiliconFlow glm-5.3 Text, Image Text
MiniMax-M3 Official MiniMax-M3 Text, Image Text
Qwen3.6 OpenRouter/SiliconFlow/vLLM qwen/qwen3.6-35b-a3b Text, Image Text, Embedding

Beyond the model-specific clients, four generic protocol clients call any compatible endpoint:

  • client_type="openai-chat" — OpenAI Chat Completions. Bare "openai" is an alias.
  • client_type="openai-chat-vllm-adapter" — Chat Completions as served by vLLM, mapping thinking_level onto the chat_template_kwargs the served model's template reads.
  • client_type="openai-responses" — OpenAI Responses, served by OpenAI, OpenRouter, DeepSeek, Z.AI, and MiniMax.
  • client_type="ant-messages" — Anthropic Messages, served by Anthropic, OpenRouter, DeepSeek, Z.AI, and MiniMax.

Where a gateway serves more than one, prefer "openai-responses": OpenRouter serves it for every model it hosts, while SiliconFlow serves Chat Completions only.

The full machine-readable list — model, base URL, client, input/output modalities, context window, and per-million-token list pricing in USD or CNY:

python
from agenthub import list_supported_models

models = list_supported_models(currency="CNY")  # "USD" by default
typescript
import { listSupportedModels } from "@prismshadow/agenthub";

const models = listSupportedModels("CNY"); // "USD" by default

Installation

Python package

Install from PyPI:

bash
uv add agenthub-python
# or
pip install agenthub-python

Build from source:

bash
cd src_py && make

See src_py/README.md for comprehensive usage examples and API documentation.

TypeScript package

Install from npm:

bash
npm install @prismshadow/agenthub

Build from source:

bash
cd src_ts && make install && make build

See src_ts/README.md for comprehensive usage examples and API documentation.

Agent Skills

AgentHub provides Codex/Claude Code skill files for assistants that need to help users consume the SDK packages:

  • Python skill: skills/agenthub-python/SKILL.md
  • TypeScript skill: skills/agenthub-typescript/SKILL.md

APIs

AutoLLMClient is the main class for interacting with the AgentHub SDK. It is constructed with model, plus optional api_key, base_url, client_type, and default_headers — headers sent with every request, for endpoints that demand their own. It provides the following methods:

  • (async) streaming_response(messages, config): Streams the response of LLMs in a stateless manner.
  • (async) streaming_response_stateful(message, config): Streams the response of LLMs in a stateful manner.
  • (async) list_models(): Lists the model ids the configured endpoint serves. A protocol client (openai-chat, openai-chat-vllm-adapter, openai-responses, ant-messages, openai-embedding) is named explicitly and lists everything the endpoint serves; a client deduced from a model id lists only the ids that deduce back to it.
  • clear_history(): Clears the history of the stateful LLM client.
  • get_history(): Returns the history of the stateful LLM client.
  • set_history(history): Replaces the history of the stateful LLM client with a copy of the provided list.

Streaming clients skip output they do not recognize, so a gateway's own frames cannot end a generation, and an event a client has nothing universal to emit for never reaches you. Set AGENTHUB_DEBUG to anything other than 0, false, no or off to make both raise instead.

Basic Usage

[!NOTE] We recommend using the stateful interface when calling the AgentHub SDK.

OpenAI GPT-5.6

Python Example:

…

TypeScript Example:

…

Anthropic Claude Opus 5

Python Example

python
import asyncio
import os
from agenthub import AutoLLMClient

os.environ["ANTHROPIC_API_KEY"] = "your-anthropic-api-key"

async def main():
    client = AutoLLMClient(model="claude-opus-5")
    async for event in client.streaming_response_stateful(
        message={
            "role": "user",
            "content_items": [{"type": "text", "text": "Say 'Hello, World!'"}]
        },
        config={}
    ):
        print(event)

asyncio.run(main())

TypeScript Example

typescript
import { AutoLLMClient } from "@prismshadow/agenthub";

process.env.ANTHROPIC_API_KEY = "your-anthropic-api-key";

async function main() {
  const client = new AutoLLMClient({ model: "claude-opus-5" });
  for await (const event of client.streamingResponseStateful({
    message: {
      role: "user",
      content_items: [{"type": "text", "text": "Say 'Hello, World!'"}]
    },
    config: {}
  })) {
    console.log(event);
  }
}

main().catch(console.error);

OpenRouter GLM-5.3

Python Example

python
import asyncio
import os
from agenthub import AutoLLMClient

os.environ["ZAI_API_KEY"] = "your-openrouter-api-key"
os.environ["ZAI_BASE_URL"] = "https://openrouter.ai/api/v1"

async def main():
    client = AutoLLMClient(model="z-ai/glm-5.3")
    async for event in client.streaming_response_stateful(
        message={
            "role": "user",
            "content_items": [{"type": "text", "text": "Say 'Hello, World!'"}]
        },
        config={}
    ):
        print(event)

asyncio.run(main())

TypeScript Example

typescript
import { AutoLLMClient } from "@prismshadow/agenthub";

process.env.ZAI_API_KEY = "your-openrouter-api-key";
process.env.ZAI_BASE_URL = "https://openrouter.ai/api/v1";

async function main() {
  const client = new AutoLLMClient({ model: "z-ai/glm-5.3" });
  for await (const event of client.streamingResponseStateful({
    message: {
      role: "user",
      content_items: [{"type": "text", "text": "Say 'Hello, World!'"}]
    },
    config: {}
  })) {
    console.log(event);
  }
}

main().catch(console.error);

SiliconFlow Qwen3.6 35B via OpenAI-compatible API

Python Example

python
import asyncio
import os
from agenthub import AutoLLMClient

os.environ["OPENAI_API_KEY"] = "your-siliconflow-api-key"
os.environ["OPENAI_BASE_URL"] = "https://api.siliconflow.cn/v1"

async def main():
    client = AutoLLMClient(model="Qwen/Qwen3.6-35B-A3B", client_type="openai-chat")
    async for event in client.streaming_response_stateful(
        message={
            "role": "user",
            "content_items": [{"type": "text", "text": "Say 'Hello, World!'"}]
        },
        config={}
    ):
        print(event)

asyncio.run(main())

TypeScript Example

typescript
import { AutoLLMClient } from "@prismshadow/agenthub";

process.env.OPENAI_API_KEY = "your-siliconflow-api-key";
process.env.OPENAI_BASE_URL = "https://api.siliconflow.cn/v1";

async function main() {
  const client = new AutoLLMClient({
    model: "Qwen/Qwen3.6-35B-A3B",
    clientType: "openai-chat",
  });
  for await (const event of client.streamingResponseStateful({
    message: {
      role: "user",
      content_items: [{ type: "text", text: "Say 'Hello, World!'" }],
    },
    config: {}
  })) {
    console.log(event);
  }
}

main().catch(console.error);

SiliconFlow Qwen3 Embedding 0.6B via OpenAI-compatible API

Python Example

python
import asyncio
import os
from agenthub import AutoLLMClient

os.environ["OPENAI_API_KEY"] = "your-siliconflow-api-key"
os.environ["OPENAI_BASE_URL"] = "https://api.siliconflow.cn/v1"

async def main():
    client = AutoLLMClient(model="Qwen/Qwen3-Embedding-0.6B", client_type="openai-embedding")

    async for event in client.streaming_response_stateful(
        message={
            "role": "user",
            "content_items": [{"type": "text", "text": "Hello world"}],
        },
        config={},
    ):
        print(event)

asyncio.run(main())

TypeScript Example

typescript
import { AutoLLMClient } from "@prismshadow/agenthub";

process.env.OPENAI_API_KEY = "your-siliconflow-api-key";
process.env.OPENAI_BASE_URL = "https://api.siliconflow.cn/v1";

async function main() {
  const client = new AutoLLMClient({
    model: "Qwen/Qwen3-Embedding-0.6B",
    clientType: "openai-embedding",
  });
  for await (const event of client.streamingResponseStateful({
    message: {
      role: "user",
      content_items: [{ type: "text", text: "Hello world" }],
    },
    config: {},
  })) {
    console.log(event);
  }
}

main().catch(console.error);

DeepSeek via the OpenAI Responses protocol

Any compatible endpoint can be called through the generic protocol clients by picking the client type (openai-chat / openai-responses / ant-messages) and the provider's base URL for that protocol:

Python Example

python
import asyncio
import os
from agenthub import AutoLLMClient

async def main():
    client = AutoLLMClient(
        model="deepseek-v4-flash",
        api_key=os.environ["DEEPSEEK_API_KEY"],
        base_url="https://api.deepseek.com",
        client_type="openai-responses",
    )
    async for event in client.streaming_response_stateful(
        message={
            "role": "user",
            "content_items": [{"type": "text", "text": "Say 'Hello, World!'"}]
        },
        config={}
    ):
        print(event)

asyncio.run(main())

TypeScript Example

typescript
import { AutoLLMClient } from "@prismshadow/agenthub";

async function main() {
  const client = new AutoLLMClient({
    model: "deepseek-v4-flash",
    apiKey: process.env.DEEPSEEK_API_KEY,
    baseUrl: "https://api.deepseek.com",
    clientType: "openai-responses",
  });
  for await (const event of client.streamingResponseStateful({
    message: {
      role: "user",

Issues· 2 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonaianthropicclaudeclaude-code

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.