Metadata-Version: 2.5
Name: agentpanel
Version: 0.1.0
Summary: Domain-agnostic multi-agent orchestration core (LangGraph) with pluggable local/cloud LLM providers.
Project-URL: Homepage, https://github.com/anzar-ahsan-commits/api-shakedown/tree/main/packages/agentpanel
Project-URL: Source, https://github.com/anzar-ahsan-commits/api-shakedown
Project-URL: Issues, https://github.com/anzar-ahsan-commits/api-shakedown/issues
Author: Anzar Ahsan
License-Expression: MIT
License-File: LICENSE
Keywords: agents,langgraph,llm,multi-agent,ollama,structured-output
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
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: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: langchain-core>=1.0
Requires-Dist: langchain-ollama>=1.0
Requires-Dist: langgraph>=1.0
Requires-Dist: pydantic-settings>=2.4
Requires-Dist: pydantic>=2.7
Provides-Extra: anthropic
Requires-Dist: langchain-anthropic>=1.0; extra == 'anthropic'
Provides-Extra: cloud
Requires-Dist: langchain-anthropic>=1.0; extra == 'cloud'
Requires-Dist: langchain-openai>=1.0; extra == 'cloud'
Provides-Extra: openai
Requires-Dist: langchain-openai>=1.0; extra == 'openai'
Description-Content-Type: text/markdown

# agentpanel

A small, domain-agnostic core for multi-agent LLM workflows on
[LangGraph](https://github.com/langchain-ai/langgraph):

- **Specialists** produce artifacts in parallel.
- **Reviewers** judge each other's artifacts; rejections send the author back to revise,
  with the feedback, for a bounded number of rounds.
- A **coordinator** assembles the result, including anything still unresolved.

It runs on local models by default ([Ollama](https://ollama.com)), with bring-your-own-key
OpenAI and Anthropic support, and gets reliable structured output from small models.

```bash
pip install agentpanel            # Ollama only
pip install "agentpanel[cloud]"   # plus OpenAI and Anthropic
```

## Example

```python
import asyncio
from agentpanel import AgentContext, LLMReviewer, LLMSpecialist, Workflow
from agentpanel.config import LLMSettings
from agentpanel.llm import create_chat_model

model = create_chat_model(LLMSettings())  # qwen3:8b on local Ollama by default


class Join:
    async def assemble(self, ctx: AgentContext) -> str:
        return ctx.artifacts["writer"].content


workflow = Workflow(
    specialists=[
        LLMSpecialist(
            name="writer",
            kind="product description",
            model=model,
            instructions="You write concise product descriptions.",
            render=lambda ctx: f"Describe {ctx.inputs['product']} in two sentences.",
        )
    ],
    reviewers=[LLMReviewer("editor", model, "You edit marketing copy for accuracy.")],
    coordinator=Join(),
    max_revisions=1,
)
result = asyncio.run(workflow.run({"product": "a solar-powered kettle"}))
print(result.result, result.unresolved)
```

## Pieces

| Module | What it gives you |
|---|---|
| `agentpanel.graph` | `Workflow`: parallel specialists, cross-review, bounded revision, progress callbacks |
| `agentpanel.agents` | `Specialist`, `Reviewer`, `Coordinator` protocols: bring any implementation |
| `agentpanel.llm_agents` | `LLMSpecialist`, `LLMReviewer`: prompt-driven agents with revision handling |
| `agentpanel.structured` | `ainvoke_structured`: pydantic-validated output with error feedback and domain `check`s; constrained decoding on Ollama |
| `agentpanel.llm` | `create_chat_model`, `check_provider`: provider factory and health checks |
| `agentpanel.config` | `LLMSettings`: env/.env settings, per-agent model and reasoning overrides |
| `agentpanel.testing` | `ScriptedChatModel`: a deterministic fake chat model for tests |

## Configuration

`LLMSettings` reads `AGENTPANEL_*` environment variables (subclass it to use your own
prefix): `PROVIDER` (`ollama`, `openai`, `anthropic`), `MODEL`, `BASE_URL`, `TIMEOUT`,
`REASONING`, `CONTEXT_WINDOW`, `AGENT_MODELS`, `AGENT_REASONING`. Cloud keys use the
standard `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`.

Built for and used by [API Shakedown](https://github.com/anzar-ahsan-commits/api-shakedown), where the
source lives. Issues and contributions: see that repository.

## License

MIT
