Metadata-Version: 2.4
Name: oomllama
Version: 0.5.0
Summary: OomLlama - Smart LLM routing with TIBET provenance. Route queries to the right model, track everything.
Project-URL: Homepage, https://humotica.com
Project-URL: Repository, https://github.com/humotica/oomllama
Project-URL: Documentation, https://humotica.com/docs/oomllama
Author: Gemini IDD
Author-email: "J. van de Meent" <jasper@humotica.com>, "R. AI" <info@humotica.com>
License: MIT
Keywords: ai,audit,inference,llama,llm,ml,ollama,provenance,qwen,routing,tibet
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: full
Requires-Dist: rich>=13.0.0; extra == 'full'
Requires-Dist: tibet-core>=0.2.0; extra == 'full'
Provides-Extra: tibet
Requires-Dist: tibet-core>=0.2.0; extra == 'tibet'
Description-Content-Type: text/markdown

# OomLlama

Smart LLM routing with TIBET provenance. Route queries to the right model, track everything.

## Installation

```bash
pip install oomllama
```

With TIBET provenance:
```bash
pip install oomllama[tibet]
```

## Quick Start

```python
from oomllama import OomLlama

# Simple generation
llm = OomLlama()
response = llm.generate("Hello!")

# With specific model
response = llm.generate("Complex question", model="qwen2.5:32b")

# Auto-routing (picks best model for the query)
llm = OomLlama(auto_route=True)
response = llm.generate("Write a Python function")  # Routes to code model
```

## Smart Routing

OomLlama automatically selects the best model based on your query:

```python
from oomllama import OomLlama, ModelRouter

llm = OomLlama(auto_route=True)

# Code query → routes to code-capable model
llm.generate("Write a binary search function")

# Simple query → routes to fast model
llm.generate("What is 2+2?")

# Complex query → routes to reasoning model
llm.generate("Explain quantum entanglement in detail...")
```

## TIBET Provenance

Track every LLM call with cryptographic provenance:

```python
from oomllama import OomLlama
from tibet_core import Provider

# Enable TIBET tracking
tibet = Provider(actor="jis:company:my_app")
llm = OomLlama(tibet=tibet)

# All calls now create provenance tokens
response = llm.generate("Summarize this document")

# Audit trail
for token in tibet.find(action="llm_generate"):
    print(f"{token.timestamp}: {token.erin['model']}")
    print(f"  Reason: {token.erachter}")
```

## CLI Usage

```bash
# Generate text
oomllama gen "Hello, how are you?"

# Auto-route
oomllama gen --auto "Write a Python web scraper"

# Interactive chat
oomllama chat -m qwen2.5:7b

# List models
oomllama list

# Check status
oomllama status
```

## Configuration

```python
from oomllama import OomLlama

llm = OomLlama(
    model="qwen2.5:7b",           # Default model
    ollama_url="http://localhost:11434",  # Ollama API
    auto_route=True,              # Enable smart routing
    system_prompt="You are helpful."  # Default system prompt
)

# Set defaults
llm.set_defaults(
    temperature=0.8,
    max_tokens=1024
)
```

## Custom Model Router

```python
from oomllama import OomLlama, ModelRouter, ModelConfig, ModelCapability

# Define your models
router = ModelRouter([
    ModelConfig(
        name="my-model:7b",
        size="7b",
        capabilities=[ModelCapability.CODE, ModelCapability.FAST],
        priority=30
    ),
])

llm = OomLlama(router=router, auto_route=True)
```

## Remote Ollama

```python
# Connect to remote GPU server
llm = OomLlama(ollama_url="http://192.168.4.85:11434")
```

## Requirements

- Python 3.10+
- [Ollama](https://ollama.ai) running locally or remotely

## License

MIT - Humotica

## Links

- [Humotica](https://humotica.com)
- [tibet-core](https://github.com/Humotica/tibet-core)
- [Ollama](https://ollama.ai)
