Metadata-Version: 2.4
Name: forge-llm-core
Version: 0.1.1
Summary: A minimal-core, zero-magic, native async/streaming framework for LLM tools & agents.
Author: Forge Contributors
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.24.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.18.0; extra == "anthropic"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"

# Forge (🔥)

> **A minimal-core, zero-magic, native async/streaming framework for LLM tools & agents.**

Forge is built as a lightweight, transparent alternative to LangChain. Instead of deep nested wrappers, magic execution chains, and implicit retries, Forge provides a **flat execution model**: `agent -> tool call -> result`.

![Forge Architecture Diagram](forge_architecture.jpg)

---

## ⚡ Key Features

- **Flat Execution Model**: Explicit, readable loops. Debugging is simple because there are no hidden layers.
- **Typed Tool Schemas**: Use Python function signatures + Pydantic for automated, clean JSON schema generation.
- **Native Async & Streaming**: Built from the ground up on async/await for fast, non-blocking execution.
- **Built-in Local Tracing**: Full visibility into exact request/response payloads without relying on external paid services.
- **Zero Bloat**: Lightweight dependencies. Optional provider packages (e.g. `anthropic`).

---

## 🚀 Quickstart

```python
import asyncio
from forge import Agent, tool, AnthropicProvider

@tool(description="Calculate the result of a mathematical expression")
def calculate(expression: str) -> str:
    return str(eval(expression))

async def main():
    provider = AnthropicProvider(model="claude-3-5-sonnet-20241022")
    agent = Agent(
        provider=provider,
        tools=[calculate],
        system_prompt="You are a helpful assistant.",
        verbose=True,
    )

    history = await agent.run("What is 128 * 42?")
    print("Answer:", history[-1].content)

if __name__ == "__main__":
    asyncio.run(main())
```

---

## 🛠️ Testing & Development

Run unit tests via `pytest`:

```bash
pytest
```
