AgentHub 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 8.5 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
AgentHub 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
AgentHub 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install agenthub
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install agenthub
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/Prism-Shadow/agenthub
cd agenthub
pip install -e .
# 验证安装
python -c "import agenthub; print('安装成功')"
# 命令行使用
agenthub --help
# 基本用法
agenthub input_file -o output_file
# Python 代码中调用
import agenthub
# 示例
result = agenthub.process("input")
print(result)
# agenthub 配置文件示例(config.yml) app: name: "agenthub" debug: false log_level: "INFO" # 运行时指定配置文件 agenthub --config config.yml # 或通过环境变量配置 export AGENTHUB_API_KEY="your-key" export AGENTHUB_OUTPUT_DIR="./output"
Integrate every model the same way, and keep one API in your head instead of one per provider.
MMSP, the Model Message Stream Protocol, takes the per-provider differences off a developer's mind: one message format and one streaming grammar for every model provider, in Python and TypeScript.
📖 Documentation: mmsp.penguin.ooo
Design: the specifications MMSP conforms to and the decisions that changed it, one RFC each, live in design/.
Using a coding agent? Install the MMSP SKILL files from skills/ so it can use MMSP correctly in generated code.
[!NOTE] We recommend using the stateful interface when calling the MMSP SDK.
TypeScript Example:
typescript import { AutoLLMClient } from "@prismshadow/mmsp";
process.env.OPENAI_API_KEY = "your-openai-api-key";
async function main() { const client = new AutoLLMClient({ model: "gpt-5.6-sol" }); for await (const event of client.streamingResponseStateful({ message: { role: "user", content_items: [{ type: "text.done", text: "Say 'Hello, World!'" }] }, config: {} })) { console.log(event); } }
main().catch(console.error); // {'role': 'assistant', 'event_type': 'delta', 'content_items': [{'type': 'text.delta', 'text': 'Hello'}], 'usage_metadata': null, 'finish_reason': null} // {'role': 'assistant', 'event_type': 'delta', 'content_items': [{'type': 'text.delta', 'text': ','}], 'usage_metadata': null, 'finish_reason': null} // {'role': 'assistant', 'event_type': 'delta', 'content_items': [{'type': 'text.delta', 'text': ' World'}], 'usage_metadata': null, 'finish_reason': null} // {'role': 'assistant', 'event_type': 'delta', 'content_items': [{'type': 'text.delta', 'text': '!'}], 'usage_metadata': null, 'finish_reason': null} // {'role': 'assistant', 'event_type': 'delta', 'content_items': [{'type': 'text.done', 'text': 'Hello, World!'}], 'usage_metadata': null, 'finish_reason': null} // {'role': 'assistant', 'event_type': 'stop', 'content_items': [], 'usage_metadata': {'cached_tokens': 0, 'prompt_tokens': 12, 'thoughts_tokens': 0, 'response_tokens': 8}, 'finish_reason': 'stop'} ```
MMSP provides detailed token usage information through the usage_metadata field of the stop event, the last event of every stream.
The usage_metadata object contains four fields: - cached_tokens: Cached input tokens - prompt_tokens: Non-cached input tokens - thoughts_tokens: Chain-of-thought output tokens - response_tokens: Non-chain-of-thought output tokens
You can calculate the total token usage as follows: - input_tokens = cached_tokens + prompt_tokens - output_tokens = thoughts_tokens + response_tokens - total_tokens = input_tokens + output_tokens
█████████████ ░░░░░░░░░░░░░ → LLM → ███████████████ ░░░░░░░░░░░░░░░
cached_tokens prompt_tokens thoughts_tokens response_tokens
input_tokens output_tokens
UniConfig is an object that contains the configuration for LLMs.
Example UniConfig:
{
"max_tokens": 1024,
"temperature": 1.0,
"tools": [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}
],
"thinking_summary": true,
"thinking_level": "none | low | medium | high | xhigh | max",
"tool_choice": "auto | required | none | a list of allowed tool names",
"system_prompt": "You are a helpful assistant.",
"prompt_caching": "enable | disable | enhance",
"fast_mode": false,
"image_config": {"aspect_ratio": "4:3", "image_size": "1K"},
"tts_config": [{"voice": "Kore"}],
"embedding_config": {"dimensions": 768},
"trace_id": null
}
AutoLLMClient is the main class for interacting with the MMSP SDK. It is constructed with model and client_type (see Clients; a model id of a known family names its official client on its own), plus optional api_key, base_url, and default_headers — headers sent with every request, for endpoints that demand their own. It provides the following methods:
A key goes only where it was given for. A key passed in is used, with the base_url passed in, else the client's <P>_BASE_URL (see Clients), else its default endpoint. Without a key, a client reads its <P>_API_KEY only when it is given no base_url or its own default endpoint: deepseek-official with no base_url or https://api.deepseek.com uses DEEPSEEK_API_KEY. Any other base_url without a key raises ApiKeyRequiredError at construction: pass the key with it, or drop it and set <P>_API_KEY, plus <P>_BASE_URL for an endpoint other than the default. Two clients are the exception, because their servers may take no key: mmsp and openai-chat-vllm-adapter call a base_url given without a key keyless, and their default endpoint too when <P>_API_KEY is unset (http://127.0.0.1:25752/v1, and http://127.0.0.1:8000/v1, where vllm serve answers); the vLLM adapter sends vLLM's placeholder key EMPTY. The rest of OpenAI's environment (OPENAI_ORG_ID, OPENAI_PROJECT_ID, OPENAI_ADMIN_KEY, OPENAI_WEBHOOK_SECRET and the headers OPENAI_CUSTOM_HEADERS lists) goes only where OPENAI_API_KEY goes: a client built on the OpenAI SDK sends none of it to a gateway, a vLLM server or another vendor's API. @prismshadow/mmsp/credentials and mmsp.credentials export the rule as data for hosts.
(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, google-genai, mmsp) 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.Both streaming methods yield delta events, each carrying one content item, followed by exactly one stop event that carries the usage and the finish reason (see UniEvent).
Streaming clients skip output they do not recognize, so a gateway's own frames cannot end a generation. Set MMSP_DEBUG to anything other than 0, false, no or off to make it raise instead.
<details><summary><strong>Python Example</strong></summary>
import asyncio
import os
from mmsp 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.8-27B", client_type="openai-chat")
async for event in client.streaming_response_stateful(
message={
"role": "user",
"content_items": [{"type": "text.done", "text": "Say 'Hello, World!'"}]
},
config={}
):
print(event)
asyncio.run(main())
</details> <details><summary><strong>TypeScript Example</strong></summary>
import { AutoLLMClient } from "@prismshadow/mmsp";
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.8-27B",
clientType: "openai-chat",
});
for await (const event of client.streamingResponseStateful({
message: {
role: "user",
content_items: [{ type: "text.done", text: "Say 'Hello, World!'" }],
},
config: {}
})) {
console.log(event);
}
}
main().catch(console.error); </details>
<details><summary><strong>Python Example</strong></summary>
import asyncio
import os
from mmsp 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.done", "text": "Hello world"}],
},
config={},
):
print(event)
asyncio.run(main()) </details>
<details><summary><strong>TypeScript Example</strong></summary>
import { AutoLLMClient } from "@prismshadow/mmsp";
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.done", text: "Hello world" }],
},
config: {},
})) {
console.log(event);
}
}
main().catch(console.error); </details>
| Model Name | Vendor | Example Model ID | Input Modalities | Output Modalities |
|---|---|---|---|---|
| Gemini 4 Argon | Official/Google Vertex AI/OpenRouter/OpenCode Go/Penguin Go | gemini-4-argon | Text, Image | Text |
| Gemini 3-3.8 | Official/Google Vertex AI/OpenRouter/Penguin Go | gemini-3.8-flash | Text, Image | Text, Image, Speech, Embedding |
| Claude 4.5-5.5 | Official/Amazon Bedrock/OpenRouter/OpenCode Go/UModelVerse | claude-opus-5-5 | Text, Image | Text |
| GPT-5.3-6.1 | Official/OpenRouter/OpenCode Go/UModelVerse | gpt-6.1-sol | Text, Image | Text, Embedding |
| Kimi-K2.5-K3.1 Pro | Official/OpenRouter/SiliconFlow/TokenDance/OpenCode Go/Fireworks AI/DashScope | kimi-k3.1-pro | Text, Image | Text |
| DeepSeek V3.2/V4 | Official/OpenRouter/SiliconFlow/TokenDance/OpenCode Go/Fireworks AI/DashScope/Qwen Token Plan/Atlas Cloud/Penguin Go/ModelScope/vLLM | deepseek-flash | Text, Image | Text |
| GLM-4.5-5.3 | Official/OpenRouter/SiliconFlow/TokenDance/OpenCode Go/Fireworks AI/DashScope/Qwen Token Plan | glm-5.3 | Text, Image | Text |
| MiniMax-M2.5-M3.1 | Official/OpenRouter/TokenDance/OpenCode Go/Fireworks AI | MiniMax-M3.1-Flash | Text, Image | Text |
| Qwen3-3.8 | OpenRouter/SiliconFlow/TokenDance/OpenCode Go/Fireworks AI/DashScope/Qwen Token Plan/Atlas Cloud/ModelScope/vLLM | qwen/qwen3.8-27b | Text, Image | Text, Embedding |
| Grok 4.3-4.7 | OpenRouter/OpenCode Go | x-ai/grok-4.7 | Text, Image | Text |
| MiMo-V2.5/V2.6 | OpenRouter/TokenDance/OpenCode Go | mimo-v2.6-pro | Text, Image | Text |
| Seed 2.0/2.1 | OpenRouter/TokenDance | seed-2.1-pro | Text, Image | Text |
| Hy3/Hy4 | OpenRouter/SiliconFlow/TokenDance/OpenCode Go | hy4-preview | Text | Text |
| Step 3.5-5 | OpenRouter/TokenDance/OpenCode Go | step-5-preview | Text, Image | Text |
| LongCat 2.0 | OpenRouter/SiliconFlow/TokenDance/OpenCode Go | longcat-2.0 | Text | Text |
| Muse Spark/Llama 4 | OpenRouter/OpenCode Go | meta/muse-spark-1.3 | Text, Image | Text |
| Mistral | OpenRouter | mistralai/mistral-large-4-0 | Text, Image | Text |
| Nemotron 3/3.5 | OpenRouter | nvidia/nemotron-3.5-super-vl | Text, Image | Text |
OpenRouter also serves Cohere Command A, Amazon Nova, Perplexity Sonar and Inception Mercury, OpenRouter and TokenDance serve inclusionAI Ling, and TokenDance serves iFlytek Spark and Dots; list_supported_models() lists every entry.
Install from PyPI:
```bash uv add mmsp
Install from npm:
npm install @prismshadow/mmsp
Build from source:
cd src_ts && make install && make build
See src_ts/README.md for comprehensive usage examples and API documentation.
AgentHub 提供了一套统一且精准的 LLM SDK,旨在简化开发者与各类大语言模型的交互流程。通过高度抽象的接口,开发者可以轻松集成不同的模型能力,实现高效的 Agent 开发与应用构建。
您可以根据开发语言选择不同的安装方式:Python 用户可以通过 PyPI 使用 `uv add agenthub-python` 进行快速安装;TypeScript 用户可以使用 npm 执行 `npm install @prismshadow/agenthub`。此外,您也可以通过源码构建方式进行安装,详见 `src_ts/README.md` 中的完整文档。
本节介绍 AgentHub SDK 的基础用法。在调用 SDK 时,我们强烈建议开发者使用 stateful interface(有状态接口),以确保在处理对话上下文时能够获得更稳定、更符合预期的交互体验。
AgentHub 引入了 UniConfig、UniMessage 和 UniEvent 等核心概念来统一数据结构。其中 UniConfig 是一个专门用于存储 LLM 配置的对象,支持定义 max_tokens、temperature 以及 tools 等关键参数,确保不同模型间的配置逻辑高度一致。
AgentHub SDK 提供了一个统一且精准的接口层。核心类 `AutoLLMClient` 是开发者进行交互的主要入口,它支持多种响应模式:包括以 stateless 方式运行的 `streaming_response` 方法,以及能够处理上下文状态的 `streaming_response_stateful` 方法,满足不同场景下的流式输出需求。
AgentHub 支持多种主流模型,包括来自 Google Vertex AI 的 Gemini 系列模型。系统能够处理 Text 和 Image 等多种 Input Modalities(输入模态),并生成 Text 形式的 Output Modalities(输出模态),为构建多模态 Agent 提供坚实的基础。
高质量的AI工作流SDK,支持多LLM
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,AgentHub 在Agent工作流赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | agenthub |
| 原始描述 | 开源AI工作流:AgentHub SDK is the unified and transparent multi-LLM SDK for building reliable 。⭐91 · Python |
| Topics | aianthropicclaudedeepseekpython |
| GitHub | https://github.com/Prism-Shadow/agenthub |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-06-01 · 更新时间:2026-06-01 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端