A bilingual unified LLM SDK supporting seamless switching between GPT, Claude, and Gemini models, offering zero-code multi-model integration, standardized tool calling, fine-grained tracing, and built-in Web UI debugging tools.
Project Overview#
AgentHub SDK is an open-source toolkit (Apache-2.0 license) developed by the Prism-Shadow organization, designed to solve the problems of fragmented LLM provider interfaces, high switching costs, and Agent debugging difficulties. By defining unified data structures like UniMessage, UniConfig, and UniEvent, it abstracts underlying model differences and allows developers to switch between models at zero cost by simply modifying the model parameter.
Core Values:
- Unified interface abstraction, shielding API differences across vendors
- Native async streaming response support
- Built-in fine-grained tracing without database dependencies
- Bilingual support (Python >=3.11, TypeScript)
Core Capabilities#
AutoLLMClient#
The core client class supports automatic routing to corresponding SDKs via the model parameter (e.g., gpt-5.2, claude-4.5, gemini-3), enabling zero-code model switching.
Supported Models#
- Gemini 3 (Official): Reasoning, tool calling, image understanding
- Claude 4.5 (Official): Reasoning, tool calling, image understanding
- GPT-5.2 (Official): Reasoning, tool calling, image understanding
- GLM-5 (Official/OpenRouter/SiliconFlow): Reasoning, tool calling
- Qwen3 (OpenRouter/SiliconFlow/vLLM): Reasoning, tool calling
Key Features#
- Unified Interface: Consistent and intuitive interface for Agent development across different LLMs
- Precise Processing: Automatic handling of interleaved thinking during multi-step tool calls
- Traceability: Lightweight fine-grained tracing via
trace_idparameter - Fine-grained Token Statistics: Distinguishes cached_tokens, prompt_tokens, thoughts_tokens, response_tokens
Installation#
Python (PyPI)#
uv add agenthub-python
# or
pip install agenthub-python
TypeScript (npm)#
npm install @prismshadow/agenthub
Quick Start Example#
import asyncio
import os
from agenthub import AutoLLMClient
os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
async def main():
client = AutoLLMClient(model="gpt-5.2")
async for event in client.streaming_response_stateful(
message={"role": "user", "content_items": [{"type": "text", "text": "Hello!"}]},
config={"temperature": 1.0}
):
print(event)
asyncio.run(main())
Core API#
streaming_response: Stateless method, requires full message history each timestreaming_response_stateful: Stateful method, automatically maintains conversation historyclear_history(): Clear conversation historyget_history(): Get conversation history
Integration Tools#
Tracer Web Server#
from agenthub.integration.tracer import Tracer
tracer = Tracer()
tracer.start_web_server(host="127.0.0.1", port=5000)
LLM Playground#
from agenthub.integration.playground import start_playground_server
start_playground_server(host="127.0.0.1", port=5001)
Project Structure#
├── src_py/ # Python implementation
├── src_ts/ # TypeScript implementation
└── llmsdk_docs/ # Model-specific documentation
Version Info#
- Current Version: v0.2.0
- License: Apache-2.0
- Primary Languages: Python (52.5%), TypeScript (47.2%)
Note: Model names like GPT-5.2, Claude 4.5, Gemini 3 mentioned in documentation have high version numbers; exact corresponding versions pending verification. npm package cannot be fully verified due to Cloudflare protection.