Skip to content

[Integration]: TealTiger governance for local LLM calls via Ollama #319

Description

@nagasatish007

Summary

Ollama runs LLMs locally. When developers use Ollama for agent workflows, they lose the governance layer that cloud API providers offer (rate limits, content filtering). TealTiger can fill that gap — providing PII detection, secret scanning, cost estimation, and policy enforcement for local LLM calls.

Why this integration?

Ollama's OpenAI-compatible API means TealTiger already works via TealOpenAI pointed at http://localhost:11434. But there are Ollama-specific concerns:

  • No built-in content filtering — Ollama models respond to anything
  • No cost tracking — local models have no usage API, but compute cost still exists
  • No audit trail — no provider-side logging of what was asked/answered
  • Tool use without governance — Ollama supports function calling, but with no access control

Proposed approach

  1. TealOllama client wrapper — wraps Ollama's API with governance (builds on OpenAI-compat)
  2. Compute cost estimation — estimate local inference cost based on model size, tokens, and hardware
  3. Full guardrails — PII, secrets, prompt injection for local models that have no built-in safety
  4. Audit trail — structured TEEC receipts for every local model interaction

Example usage

from tealtiger.integrations.ollama import TealOllama

client = TealOllama(
    host="http://localhost:11434",
    guardrails={
        "pii_detection": True,
        "secret_detection": True,
        "prompt_injection": True,
    },
    budget={
        "max_requests_per_session": 100,  # Rate limit for local models
    },
)

response = client.chat(
    model="llama3.1",
    messages=[{"role": "user", "content": "Summarize user data"}],
)
# Governance evaluated before and after the local model call

Deliverables

  • tealtiger.integrations.ollama module
  • TealOllama client wrapping Ollama's OpenAI-compatible API
  • Local compute cost estimation (tokens × model-size factor)
  • Full guardrail suite for unfiltered local models
  • Example: governed local agent with Ollama + TealTiger
  • Blog post: "Why local LLMs need governance too"

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Backlog
    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions