Metadata-Version: 2.5
Name: ollaborate
Version: 0.1.0
Summary: Multi-agent orchestration for Ollama, without the framework tax.
Project-URL: Homepage, https://github.com/patha325/ollaborate
Project-URL: Repository, https://github.com/patha325/ollaborate
Project-URL: Issues, https://github.com/patha325/ollaborate/issues
Author: Patrik Hallsjö
License: MIT
License-File: LICENSE
Keywords: agents,llm,local-ai,multi-agent,ollama
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: ollama>=0.4.7
Requires-Dist: pydantic>=2.7
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.14; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.9; extra == 'dev'
Description-Content-Type: text/markdown

# Ollaborate

**Multi-agent orchestration for Ollama, without the framework tax.**

Ollaborate gives local models a clean team API: define specialists, choose a proven collaboration pattern, and run. No cloud keys, YAML maze, graph DSL, or hidden global state.

```bash
pip install ollaborate
ollama pull qwen3:8b
```

```python
import asyncio
from ollaborate import Agent, Team


async def main():
    researcher = Agent("Curie", "evidence-focused researcher")
    skeptic = Agent("Feynman", "skeptical reviewer")
    editor = Agent("Sagan", "clear technical editor")

    result = await Team(researcher, skeptic, editor).panel(
        "Can a Mars settlement manufacture its own rocket propellant?",
        synthesizer=editor,
    )
    print(result.output)


asyncio.run(main())
```

## Why Ollaborate?

- **Small API:** `Agent` and `Team` are enough to begin.
- **Useful patterns:** concurrent panels, sequential pipelines, bounded debates, and supervisor routing.
- **Native Ollama:** tools and JSON-schema structured outputs use Ollama directly.
- **Inspectable:** every contribution is returned; lifecycle events support logging and UIs.
- **Safe by construction:** tool loops and debates are bounded.
- **Hackable:** ordinary Python, callable tools, and dependency injection for testing.

## Patterns

```python
await team.pipeline(task)  # A → B → C
await team.panel(task, synthesizer=editor)  # A + B → editor
await team.debate(task, rounds=2, judge=editor)  # bounded critique → verdict
await team.route(task, router=dispatcher)  # choose one specialist
```

Every run returns a `RunResult` with `.output` and `.contributions`.

## Tools

Pass ordinary typed Python functions. Ollama derives their tool schemas from signatures and docstrings.

```python
def weather(city: str) -> str:
    """Return the current weather for a city."""
    return "12 C and raining"


analyst = Agent("Analyst", "travel analyst", tools=[weather])
```

Treat model-requested tool arguments as untrusted input. Keep dangerous tools sandboxed and require human approval where appropriate.

## Structured outputs

```python
from pydantic import BaseModel


class Finding(BaseModel):
    claim: str
    confidence: float


finding = await researcher.run("Assess the claim", output_type=Finding)
```

## Observability

```python
team = Team(researcher, skeptic, on_event=lambda event: print(event.kind, event.agent))
```

Events include agent starts/ends, tool calls/results, and errors. Do not log secrets returned by tools.

## Development

```bash
python -m venv .venv
. .venv/bin/activate  # Windows: .venv\\Scripts\\activate
pip install -e ".[dev]"
ruff check .
pytest
python -m build
```

## Status

Ollaborate is alpha software. The public API is intentionally small, but may evolve before 1.0.

## License

MIT. Ollaborate is an independent project and is not affiliated with Ollama.

