dreadnode/rigging

Lightweight LLM Interaction Framework

What it solves

Rigging 简化了大型语言模型(LLM)在生产代码中的集成。它去除了管理不同模型提供商、处理结构化数据以及构建复杂聊天流水线的样板代码,使得在软件中使用 AI 的过程更高效且可预测。

How it works

Rigging 作为轻量级框架,利用 LiteLLM、vLLM 和 transformers 提供统一接口,支持多种模型。它允许开发者将提示定义为带类型提示和 docstring 的 Python 函数,并使用 Pydantic 模型进行结构化输出验证。模型配置通过类似数据库连接的 connection strings 管理,并支持高并发的 async batching 生成。

Who it’s for

需要灵活、类型安全且可投入生产的库来管理提示、工具使用和模型切换的 AI 代理或 LLM 驱动应用的开发者。

Highlights

  • Unified Model Access: Instant access to numerous models via LiteLLM, vLLM, and transformers.
  • Structured Data: Seamlessly switch between unstructured text and Pydantic models for validated output.
  • Prompt Engineering: Define prompts as Python functions with built-in type hints.
  • Production Tooling: Integrated tracing with Logfire, async batching, and serialization support.
  • Flexible Tool Use: Simple tool integration, even for models that do not natively support tool-calling APIs.