Skip to main content

Smart LLM routing with TIBET provenance - route queries to Ollama/OpenAI/Anthropic automatically

Project description

TIBET LLM Router

Smart LLM routing with TIBET provenance - route queries to Ollama/OpenAI/Anthropic automatically

PyPI License: MIT

Note: This package replaces tibet-router. The name tibet-router is reserved for TIBET token routing (like jis-router for RABEL).

Quick Start

from llm_router import LLMRouter

# Simple usage
llm = LLMRouter()
response = llm.generate("Hello!")

# Auto-routing (picks best model for your query)
llm = LLMRouter(auto_route=True)
response = llm.generate("Write a Python function")  # Routes to code model
response = llm.generate("Quick question")  # Routes to fast model

Installation

pip install tibet-llm-router

# With TIBET provenance tracking
pip install tibet-llm-router[tibet]

Features

  • Auto-Routing: Automatically selects the best model for your query
  • Code Detection: Routes code queries to specialized code models
  • Complexity Analysis: Complex queries go to reasoning models
  • TIBET Provenance: Full audit trail of all LLM calls
  • Ollama Integration: Works with any Ollama-compatible backend

CLI Usage

# Generate text
llm-router gen "Write a haiku about AI"

# Auto-route
llm-router gen --auto "Complex philosophical question"

# Preview routing
llm-router route "Write Python code"
# Output: Model: deepseek-coder:6.7b, Reason: code query detected

# Interactive chat
llm-router chat --auto

# Check status
llm-router status

With TIBET Provenance

from llm_router import LLMRouter
from tibet_core import Provider

# Track all LLM calls
tibet = Provider(actor="my_app")
llm = LLMRouter(tibet=tibet, auto_route=True)

response = llm.generate("Explain quantum computing")
# Full provenance chain: who, what, when, why

Model Configuration

from llm_router import LLMRouter, ModelRouter, ModelConfig, ModelCapability

# Custom router
router = ModelRouter()
router.add_model(ModelConfig(
    name="my-custom-model:7b",
    size="7b",
    capabilities=[ModelCapability.CODE, ModelCapability.FAST],
    priority=50  # Higher = preferred
))

llm = LLMRouter(router=router, auto_route=True)

Environment Variables

Variable Default Description
OLLAMA_URL http://localhost:11434 Ollama API URL

Part of Humotica Stack

LLM Router is part of the Humotica AI ecosystem:

Package Description
tibet-core TIBET provenance tracking
oomllama .oom format Q2/Q4 quantization
rapid-rag Local RAG with semantic search

Links


One Love, One fAmIly

Built by Humotica AI Lab - Jasper, Claude, Gemini

License

MIT

Credits

Designed by Jasper van de Meent. Built by Jasper and Root AI as part of HumoticaOS.


Stack-positie: Groep agentic · Bootstrap = OSAPI-handshake naar tibet + jis (fail → snaft-rule + tibet-pol-rapport) · ← ollama-bridge · tibet-gateway → · See STACK.md · See demo/golden-path/ for the spine end-to-end.

Enterprise

For private hub hosting, SLA support, custom integrations, or compliance guidance:

Enterprise enterprise@humotica.com
Support support@humotica.com
Security security@humotica.com

See ENTERPRISE.md for details.

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

tibet_llm_router-0.1.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

tibet_llm_router-0.1.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file tibet_llm_router-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for tibet_llm_router-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4986608eec1865cf67465ad9372da53938465e6d35c05c8e79d9279ff3d81e22
MD5 64b2aa83a745a2c9aabbb4015c490e8d
BLAKE2b-256 7afde26ec5040d7350eb9fed7788dc421692414610de883cc6cf2c7675741bce

See more details on using hashes here.

File details

Details for the file tibet_llm_router-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tibet_llm_router-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49b66b39b864eca318dae0139407e7e5c61f98323ba7adf735eba404d1a3aa5c
MD5 ae7317d5811d3213d2bccd770420ac39
BLAKE2b-256 b163fb581e690b6f254473cad8b9a4b2c7ea6995d2ef5dd31046ff9a0db76311

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