Skip to main content

Rein

5 行代码,把任意大模型变成能调工具、自己循环干活的 agent。

test

Rein 是一个极薄但生产级的单-agent harness(智能体运行时)框架。反 LangChain 式的重抽象,聚焦把"单 agent 的 loop + 工具 + 可控 + 可观测"做到极致。

安装

pip install rein-agent   # 装完即接入真实大模型(100+ 厂商,经 LiteLLM)

快速开始

from rein import Agent

agent = Agent(model="anthropic/claude-opus-4-8")

@agent.tool
def read_file(path: str) -> str:
    "读取文件内容"
    return open(path).read()

print(agent.run("读 README 并总结"))

核心特性

  • 多厂商:wrap LiteLLM,一行切换 100+ 厂商模型 + 自动 fallback
  • 可序列化状态机:Loop 状态全在可序列化 Session 里 → 天生支持 HITL 人工审批、断点续跑
  • 熔断四道闸:轮数 / token / 超时 / 重复检测,防 agent 失控烧钱
  • 并发安全:Agent(无状态蓝图)/ Session(状态)/ Chat(会话句柄)三者分离
  • 可观测:结构化 RunResult + 可选 OpenTelemetry 导出
  • 可扩展:中间件 / 钩子 / 事件 / Docker 沙箱 / 插件
  • 脚手架:rein new 一键起项目

许可证

Apache-2.0

Metadata

Release files for rein-agent 0.2.0

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

Source distribution (sdist)

Source distribution for rein-agent 0.2.0
File Size Uploaded Provenance Actions
rein_agent-0.2.0.tar.gz 81.0 kB Without provenance Details for rein_agent-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rein-agent 0.2.0
File Interpreter ABI Platform Actions
rein_agent-0.2.0-py3-none-any.whl Python 3 none any Details for rein_agent-0.2.0-py3-none-any.whl

Total release size: 149.0 kB

Release files / rein_agent-0.2.0.tar.gz

Download URL rein_agent-0.2.0.tar.gz
Size 81.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f91ff6ddac37f69cc1cb3007a76e08edd2b29babb50c709b19b1dd138430b94d
BLAKE2b-256 checksum
How to use checksums
7b08300d2dfbce8d6835bfebd0db5a74ed30d348d2e88de9e3091dd687069a24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / rein_agent-0.2.0-py3-none-any.whl

Download URL rein_agent-0.2.0-py3-none-any.whl
Size 68.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8c8551277d03c293d6be59d0fd5608884f50665959db6a325f4570d929285e9
BLAKE2b-256 checksum
How to use checksums
ea5c59e08aada151fe17a4e2f15823591576ccb45c245bd57e6b1dc0d45bee56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for rein-agent 0.2.0

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.

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