Metadata-Version: 2.5
Name: lazybridge
Version: 1.8.7
Summary: Zero-boilerplate multi-provider LLM agent framework
Project-URL: Homepage, https://github.com/selvaz/LazyBridge
Project-URL: Repository, https://github.com/selvaz/LazyBridge
Project-URL: Documentation, https://core.lazybridge.com
Project-URL: Changelog, https://github.com/selvaz/LazyBridge/blob/main/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/selvaz/LazyBridge/issues
Author: selvaz
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: agent-framework,agents,ai-agents,anthropic,claude-code,codex,google,llm,mcp,multi-agent,openai,orchestration,pipeline,tool-use
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: pydantic<3.0.0,>=2.0.0
Provides-Extra: all
Requires-Dist: anthropic<1.0.0,>=0.49.0; extra == 'all'
Requires-Dist: claude-agent-sdk>=0.1.51; extra == 'all'
Requires-Dist: cryptography<51,>=42; extra == 'all'
Requires-Dist: google-genai<2.0.0,>=1.10.0; extra == 'all'
Requires-Dist: griffe<3.0,>=1.0; extra == 'all'
Requires-Dist: litellm<2.0.0,>=1.40.0; extra == 'all'
Requires-Dist: mcp; extra == 'all'
Requires-Dist: openai<4.0.0,>=1.70.0; extra == 'all'
Requires-Dist: opentelemetry-api<2.0,>=1.20; extra == 'all'
Requires-Dist: opentelemetry-sdk<2.0,>=1.20; extra == 'all'
Requires-Dist: pyyaml<7.0,>=6.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic<1.0.0,>=0.49.0; extra == 'anthropic'
Provides-Extra: claude-code
Requires-Dist: claude-agent-sdk>=0.1.51; extra == 'claude-code'
Requires-Dist: mcp; extra == 'claude-code'
Requires-Dist: tzdata; (sys_platform == 'win32') and extra == 'claude-code'
Provides-Extra: deepseek
Requires-Dist: openai<4.0.0,>=1.70.0; extra == 'deepseek'
Provides-Extra: docparse
Requires-Dist: griffe<3.0,>=1.0; extra == 'docparse'
Provides-Extra: docs
Requires-Dist: mkdocs-llmstxt<1.0,>=0.3; extra == 'docs'
Requires-Dist: mkdocs-material<10.0,>=9.5; extra == 'docs'
Requires-Dist: mkdocstrings[python]<2.0,>=0.24; extra == 'docs'
Requires-Dist: pymdown-extensions<13.0,>=10.0; extra == 'docs'
Provides-Extra: encryption
Requires-Dist: cryptography<51,>=42; extra == 'encryption'
Provides-Extra: google
Requires-Dist: google-genai<2.0.0,>=1.10.0; extra == 'google'
Provides-Extra: litellm
Requires-Dist: litellm<2.0.0,>=1.40.0; extra == 'litellm'
Provides-Extra: openai
Requires-Dist: openai<4.0.0,>=1.70.0; extra == 'openai'
Provides-Extra: otel
Requires-Dist: opentelemetry-api<2.0,>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-sdk<2.0,>=1.20; extra == 'otel'
Provides-Extra: test
Requires-Dist: griffe<3.0,>=1.0; extra == 'test'
Requires-Dist: pydantic<3.0.0,>=2.0.0; extra == 'test'
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest-cov>=4.0; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Requires-Dist: pyyaml<7.0,>=6.0; extra == 'test'
Provides-Extra: yaml
Requires-Dist: pyyaml<7.0,>=6.0; extra == 'yaml'
Description-Content-Type: text/markdown

# LazyBridge

[![tests](https://github.com/selvaz/LazyBridge/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/selvaz/LazyBridge/actions/workflows/test.yml)
[![docs](https://github.com/selvaz/LazyBridge/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/selvaz/LazyBridge/actions/workflows/docs.yml)
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)

**Everything is a tool.** LazyBridge is a Python agent framework where
functions, agents and whole pipelines plug into each other the same way, and
the engine underneath is swappable. **Agent = Engine + Tools + State.**

- **Everything is a tool.** A function, another agent or a Plan-backed
  pipeline all enter through `tools=[...]`, so agents compose into teams
  without glue code.
- **API, Claude Code or Codex: peer engines.** Provider API models
  (Anthropic, OpenAI, Google, DeepSeek, LiteLLM), Claude Code and Codex are
  all first-class engines behind the same `Agent`. Swap one for another and
  keep tools, memory and state; use any one alone or mix them. With a
  subscription login the coding runtimes use the account's plan quota instead
  of per-token API billing.
- **Fleets, not just chats.** Deterministic `Plan` DAGs with checkpoint/resume
  and `run_many` fan-out, `Agent.parallel`, `verify=` writer/reviewer loops,
  human-in-the-loop engines, and a durable control plane (atomic claims,
  fencing, append-only ledger) for many workers on one machine.

## Try it in two minutes

```sh
python -m pip install "lazybridge[claude-code,deepseek]==1.8.7"
python -m lazybridge.demo
```

The demo finds which engines this machine can use, gives each the same Python
tool and question, then lets one engine write and another review. Enable any
one of them, or all three:

| Engine | Enable it |
|---|---|
| DeepSeek API | set `DEEPSEEK_API_KEY` (key from platform.deepseek.com) |
| Claude Code | `npm install -g @anthropic-ai/claude-code`, then run `claude` once to sign in |
| Codex | `npm install -g @openai/codex`, then run `codex login` |

```text
Engines on this machine:
  [x] deepseek
  [x] claude-code
  [x] codex

1) Same tool, same question, 3 engine(s):
   deepseek     LazyBridge treats an agent as an engine plus tools and state, where engines are swappable peers ...
   claude-code  ...
   codex        LazyBridge defines agents as engines plus tools and state, with swappable engines ...

2) deepseek writes, codex reviews (verify=):
print([i**2 for i in range(1, 6)])
```

The demo is one short file, [`lazybridge/demo.py`](https://github.com/selvaz/LazyBridge/blob/main/lazybridge/demo.py):
read it to see the whole API it uses.

```python
from lazybridge import Agent, ClaudeCodeEngine, CodexEngine, LLMEngine, 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())
api = Agent(name="api", engine=LLMEngine("claude-haiku-4-5"), **state)
claude = Agent(name="claude", engine=ClaudeCodeEngine(), **state)
codex = Agent(name="codex", engine=CodexEngine(), **state)
assert api.memory is claude.memory is codex.memory
assert api.store is claude.store is codex.store
assert api.session is claude.session is codex.session

# An agent is a tool too: the lead can delegate to Codex.
lead = Agent(name="lead", engine=ClaudeCodeEngine(), tools=[project_status, codex])
```

`LLMEngine` calls provider APIs; `Plan` runs a deterministic DAG; human engines
handle approval and supervision. Every agent returns an `Envelope`.

## Install and authenticate

Python 3.11 or later:

```sh
python -m pip install "lazybridge[claude-code]==1.8.7"
```

Install and sign in to the local coding runtimes using the
[Claude Code guide](https://core.lazybridge.com/guides/full/claude-code-engine/)
and [Codex guide](https://core.lazybridge.com/guides/full/codex-engine/).
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.

## One writes, the other reviews

```python
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](https://core.lazybridge.com/guides/full/claude-writes-codex-reviews/).

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 connects the work

[LazyTools](https://tools.lazybridge.com/) is the integration layer:

- [Code bridge](https://tools.lazybridge.com/code-bridge/): detached repository jobs, durable approvals, results and tier-based opposite-engine review.
- [MCP server](https://tools.lazybridge.com/mcp-server/): code-support tools, projects and connectors.
- [Projects](https://tools.lazybridge.com/projects/): plans, claims, contracts and acceptance evidence in a shared Store.

Its distribution is `lazytoolkit`; its Python namespace is `lazytools`. Install
from the GitHub tag (add the `engines` extra for Claude or tier routing):

```sh
pip install "lazytoolkit[mcp] @ git+https://github.com/selvaz/LazyTools@v0.10.6"
```
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.

## Documentation and status

This README targets **1.8.7**.
The core public API is Stable; coding engines and extensions have their own
boundaries. LazyTools 0.10.1 declares Alpha. See the
[maturity table](https://core.lazybridge.com/#maturity) and [CHANGELOG](CHANGELOG.md).

- [Quickstart](https://core.lazybridge.com/quickstart/)
- [Coding agents and engine differences](https://core.lazybridge.com/guides/full/coding-agents/)
- [Recipes](https://core.lazybridge.com/recipes/) and [API reference](https://core.lazybridge.com/reference/)
- [For LLM assistants](https://core.lazybridge.com/for-llms/)
- [Website and working projects](https://lazybridge.com/)

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](CONTRIBUTING.md) describes the checks.

The longer design rationale and worked examples live in
[Why LazyBridge](https://core.lazybridge.com/why/) (recursive pipelines,
validation, review and exporters), the
[comparison](https://core.lazybridge.com/comparison/), and the
[documentation map](https://core.lazybridge.com/#design-and-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](SECURITY.md) for disclosure and [LICENSE](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.
