Skip to main content

AgentInfer

AgentInfer 为智能体工作流提供缓存管理和请求调度能力,可集成到 vLLM 等 LLM 推理引擎中或作为前置请求路由器运行。

English

核心特性

  • Semantic Router(语义路由):面向异构 LLM 推理的可编程 Mixture-of-Models 路由器,通过连续性感知的 模型选择优化多轮智能体会话,减少破坏性且高代价的模型切换。
  • Router(路由器):面向 vLLM 大规模部署的高性能、轻量级路由器,提供 Agent 感知调度策略与 智能体工作流建模。
  • Agent Cache(智能体缓存):vLLM 插件,在智能体工作负载下负责请求调度以及 Ascend NPU 原生 KV Cache 管理、池化与传输。
  • AgentBench(基准测试):面向智能体工作负载下推理引擎的基准测试,支持真实智能体运行与 轨迹数据集回放两种模式。

架构

AgentInfer 架构图

相关文档

文档导航 · 快速开始 · vLLM 接入 · 基准测试指南 · AgentRouter WASM affinity + native 补丁 · 变更日志

环境要求

  • 操作系统:Linux,或安装了 WSL 2 的 Windows。
  • Python:3.10 或更高版本,与 pyproject.toml 中的 requires-python 保持一致。
  • 推理运行时:vLLM 0.23.0。
  • 硬件:与 vLLM 兼容且能够运行所选模型的 CUDA GPU。

AgentInfer 必须与 vLLM 安装在同一 Python 环境中。

安装指南

从源码安装

开发环境中,先激活目标 vLLM 环境,再以可编辑模式安装 AgentInfer:

git clone https://gitcode.com/openJiuwen/agent-infer.git
cd agent-infer
python -m pip install -e .

安装发布包

下载 AgentInfer 0.1.0 wheel,然后在目标 vLLM 环境中安装:

python -m pip install agentinfer-0.1.0-py3-none-any.whl

Quick Start

使用单一参数启动 AgentInfer 服务路径:

vllm serve meta-llama/Llama-3.1-8B-Instruct --agentinfer

未设置 AGENTCACHE_VLLM_LIFECYCLE_SOCKET 时,生命周期 socket 默认为 /tmp/agentinfer-vllm-lifecycle.sock;同一主机上的多个服务实例需分别导出不同的 socket。 仓库中的等效示例位于 examples/serve-progress-ttl.sh。

安装后的 vllm 命令会将普通命令委托给上游 vLLM。显式的 vllm bench serve --agentinfer 命令进入 AgentBench;vllm serve MODEL --agentinfer 激活 AgentInfer 服务路径;其他命令原样委托给上游。标准服务参数见 vLLM Quickstart。

Router 会话亲和

会话亲和通过 WASM agent_hint_affinity 插件接入,需要带 --wasm-middleware 的上游 vLLM Router (#251 及之后)。插件构建和启动命令见 agentinfer/agentrouter。原生 agent_hint_token_offsets 仍是该目录下的可选补丁。

License

本项目基于 Apache License 2.0 开源。

本产品仅作为流程编排工具,不包含 AI 模型能力;用户在连接 AI 模型用于特定业务场景时,需自行承担欧盟 AI 法案等相关合规义务。

Metadata

Release files for agentinfer-zmj-test 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentinfer-zmj-test 0.1.1
File Size Uploaded Provenance
agentinfer_zmj_test-0.1.1.tar.gz 285.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentinfer-zmj-test 0.1.1
File Interpreter ABI Platform
agentinfer_zmj_test-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 633.8 kB

Release files / agentinfer_zmj_test-0.1.1.tar.gz

Download URL agentinfer_zmj_test-0.1.1.tar.gz
Size 285.3 kB
Tags Source
SHA-256 checksum
How to use checksums
44586e550920187267d6d465ea016257bd5dcbdda05401dd19b50c32e25e21ac
BLAKE2b-256 checksum
How to use checksums
10976ab5f9fbecf22a9612168edc34933eede1fb20c548dc4a8cf84c74fa02b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / agentinfer_zmj_test-0.1.1-py3-none-any.whl

Download URL agentinfer_zmj_test-0.1.1-py3-none-any.whl
Size 348.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
997c9c18e2db4d405f8e84d183a185b692453d7e6aaa7ea471ebb9665084c45b
BLAKE2b-256 checksum
How to use checksums
549439b06c9f93aa271128a14efbb3bf142f0b6d519cbce93f90ed41aa75fda3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for agentinfer-zmj-test 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page