Python framework for composable LLM workflows.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Status: stable (1.0.1+). The core public API (Agent, Plan,
Tool, Envelope) will not break without a major version bump — see
CHANGELOG and the Maturity table
for which subsystems are still Alpha/Experimental.
Zero-boilerplate, multi-provider Python framework for LLM agents. One
Agent class, swappable engines (LLM / Plan / Human / Supervisor), and one
tool contract — plain Python functions, other Agents, MCP servers, and full
pipelines all compose through tools=[...]. Parallelism is automatic when the
engine emits N tool calls in a turn; deterministic when you declare it.檢視完整 README ↗Build Python pipelines with Claude Code and Codex as engines. Swap the engine while keeping tools and application state; let one engine write and the other review. Agent = Engine + Tools + State is the shared contract.
from lazybridge import Agent, ClaudeCodeEngine, CodexEngine, Memory, Session, Store
def project_status() -> str:
"""Return this example project's status."""
return "The draft is ready for review."
state = dict(tools=[project_status], memory=Memory(), store=Store(), session=Session())
claude = Agent(name="claude", engine=ClaudeCodeEngine(), **state)
codex = Agent(name="codex", engine=CodexEngine(), **state)
assert claude.memory is codex.memory
assert claude.store is codex.store
assert claude.session is codex.session
Functions, agents and Plan-backed pipelines enter through tools=[...].
LLMEngine calls provider APIs; Plan runs a deterministic DAG; human engines
handle approval and supervision. Every agent returns an Envelope.
Python 3.11 or later:
python -m pip install "lazybridge[claude-code]==1.8.4"
Install and sign in to the local coding runtimes using the
Claude Code guide
and Codex guide.
Codex needs its CLI, with no Python SDK extra. With a subscription login,
coding runtimes use the account's plan quota; the adapters reuse the configured
authentication and do not force a billing path. For provider APIs, install the
matching extra (anthropic, openai, google, deepseek, litellm) and
configure that provider's credentials.
from lazybridge import Agent, ClaudeCodeEngine, CodexEngine
reviewer = Agent(name="codex-reviewer", engine=CodexEngine(
system='Start with "approved" or "rejected: <reason>". Check boundary cases.',
))
writer = Agent(name="claude-writer", engine=ClaudeCodeEngine(),
verify=reviewer, max_verify=3)
result = writer("Draft a function that blocks weekend deployment.")
print(result.text())
verify= is configured on the Agent. Rejection supplies feedback for the next
attempt; max_verify counts total attempts. Exhaustion returns the final draft
even when rejected. Use deterministic tests and explicit acceptance records
before shipping. See the full
Claude Code writes, Codex reviews guide.
Native history can survive a process restart: Claude has persist_session /
session_id, Codex has persist_thread / thread_id, and both support
session_alias through SessionRegistry. Python Memory, Store and Session
can be reused when changing engines; a native Claude transcript cannot migrate
into a Codex thread.
LazyTools is the integration layer:
Its distribution is lazytoolkit; its Python namespace is lazytools.
Core MCP/gateway shims were removed in 0.9. Follow the LazyTools installation
instructions rather than importing those removed modules.
Code computes results; the LLM reads them. Deterministic gates decide what may ship. Quota routing chooses from eligible tier rungs; the quota routing benchmark is in progress, with no comparative metrics published here.
This README targets 1.8.4. The core public API is Stable; coding engines and extensions have their own boundaries. LazyTools 0.10.1 declares Alpha. See the maturity table and CHANGELOG.
For development, install .[test,docs], run python -m pytest, and build with
python -m mkdocs build --strict. The default suite excludes live model calls
and heavy rendering. CONTRIBUTING describes the checks.
The longer design rationale and worked examples live in Why LazyBridge (recursive pipelines, validation, review and exporters), the comparison, and the documentation map. This keeps the README focused while preserving those explanations in the guides.
Issues and contributions are welcome through the repository. See SECURITY.md for disclosure and LICENSE for Apache 2.0 terms. LazyBridge is designed by selvaz with Claude Code and Codex used as implementation partners under the owner's direction.