Skip to main content

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

Project description

OomLlama

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

Installation

pip install oomllama

With TIBET provenance:

pip install oomllama[tibet]

Quick Start

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:

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:

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

# 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

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

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

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

Requirements

  • Python 3.10+
  • Ollama running locally or remotely

License

MIT - Humotica

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oomllama-0.5.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oomllama-0.5.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file oomllama-0.5.0.tar.gz.

File metadata

  • Download URL: oomllama-0.5.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for oomllama-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8ac85efc828405248c91cbf616dd5c14b4b3b18f88cf601b7d3b1a8187744a02
MD5 95eef7d81f973e07506bfb5db9b8e0ad
BLAKE2b-256 ea39989ead4f549137d509ef6f5a1b33dc107b9a663b1ae75fb673a27f8969e1

See more details on using hashes here.

File details

Details for the file oomllama-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: oomllama-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for oomllama-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3140aa744c83071799b54ba8974c0347f1c61a7d171191951a8a7e341dfa849
MD5 a7b8e04f5db6f5845da2e152ce8f41b7
BLAKE2b-256 457707b89779ba0b98cebdf8153eeada50414943717469f1f282dbc2f4fcf354

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page