Skip to main content

FrootAI SDK — The open glue for AI architecture. Offline access to 16 knowledge modules, 20 solution plays, cost estimation, evaluation, and A/B testing.

Project description

FrootAI — Python SDK

Offline-first access to 16 AI architecture knowledge modules, 20 solution plays, cost estimation, evaluation, and A/B testing. Zero external dependencies.

PyPI Python License: MIT

Install

pip install frootai

Quick Start

from frootai import FrootAI, SolutionPlay, Evaluator

# Search 682KB knowledge base (16 modules across 5 FROOT layers)
client = FrootAI()
results = client.search("RAG architecture")
for r in results:
    print(f"[{r['module_id']}] {r['title']}{r['relevance']} hits")

# Get a specific module
module = client.get_module("R2")  # RAG Architecture & Retrieval
print(f"{module['title']}: {module['content_length']:,} chars")

# List all FROOT layers
for layer in client.list_layers():
    print(f"{layer['emoji']} {layer['name']} ({len(layer['modules'])} modules)")

# Estimate Azure costs
cost = client.estimate_cost("01-enterprise-rag", scale="prod")
print(f"${cost['monthly_total']}/mo")

# Browse 20 solution plays
plays = SolutionPlay.all()
ready = SolutionPlay.ready()  # 3 production-ready
by_layer = SolutionPlay.by_layer("R")  # Reasoning layer plays

Features

Knowledge Search (offline, no API calls)

client = FrootAI()

# Full-text search across 16 modules (643KB of real content)
results = client.search("embeddings", max_results=5)

# Get module by ID
mod = client.get_module("O2")  # AI Agents & Microsoft Agent Framework

# List all modules
for m in client.list_modules():
    print(f"{m['emoji']} {m['id']} {m['title']} ({m['content_length'] // 1024}KB)")

# Extract a specific section
section = client.get_module_section("F1", "Table of Contents")

Glossary (159+ terms extracted from content)

# Look up a term
term = client.lookup_term("temperature")

# Search glossary
terms = client.search_glossary("embedding", max_results=10)

Cost Estimation

# Estimate monthly Azure costs for a solution play
cost = client.estimate_cost("01-enterprise-rag", scale="dev")
# {'play': '01-enterprise-rag', 'scale': 'dev', 'monthly_total': 430, 'breakdown': {...}}

cost = client.estimate_cost("01-enterprise-rag", scale="prod")
# {'monthly_total': 3600, 'breakdown': {'openai-gpt4o': 2500, 'ai-search-standard': 750, ...}}

Solution Plays (20 pre-tuned architecture blueprints)

from frootai.plays import SolutionPlay

play = SolutionPlay.get("03")
print(f"{play.name}: {play.description}")
print(f"Infrastructure: {play.infra}")
print(f"Tuning params: {play.tuning}")
print(f"Related modules: {play.modules}")

# Filter by FROOT layer
orchestration_plays = SolutionPlay.by_layer("O_ORCH")

Evaluation (quality gates)

from frootai import Evaluator

evaluator = Evaluator()
scores = {"groundedness": 4.5, "relevance": 3.2, "coherence": 4.1, "fluency": 4.8}

results = evaluator.check_thresholds(scores)
print(evaluator.summary(scores))
# 3/4 checks passed (relevance 3.2 < threshold 4.0)

A/B Testing (prompt experiments)

from frootai.ab_testing import PromptExperiment, PromptVariant

# You provide the model function — no fake scores
def my_model(system_prompt, query):
    return call_your_llm(system_prompt=system_prompt, user_message=query)

def my_scorer(query, response):
    return {"groundedness": 4.5, "relevance": 4.0}

experiment = PromptExperiment(
    name="system-prompt-v2",
    variants=[
        PromptVariant("control", "You are a helpful assistant."),
        PromptVariant("expert", "You are an Azure AI expert. Cite sources."),
    ],
)

results = experiment.run(["What is RAG?"], model_fn=my_model, scorer_fn=my_scorer)
print(f"Winner: {experiment.pick_winner(results)}")

CLI

frootai plays                    # List all 20 solution plays
frootai plays --ready            # Show production-ready plays only
frootai plays --layer R          # Filter by FROOT layer
frootai search "embeddings"      # Search knowledge base
frootai modules                  # List all 16 modules with sizes
frootai glossary temperature     # Look up a term
frootai cost 01-enterprise-rag   # Estimate Azure costs
frootai cost 01-enterprise-rag --scale prod
frootai --version                # Show version

What's Inside

  • 16 knowledge modules (643KB) across 5 FROOT layers: Foundations, Reasoning, Orchestration, Operations, Transformation
  • 20 solution plays with infrastructure, tuning parameters, and module mapping
  • 159+ glossary terms extracted from module content
  • Cost estimation for 10 plays with dev/prod breakdowns
  • Evaluation framework with configurable thresholds
  • A/B testing framework with real model callbacks (no fake scores)
  • Zero external dependencies — pure Python stdlib

FROOT Layers

Layer Emoji Name Modules
F 🌱 Foundations F1-F4 (GenAI, LLMs, Glossary, Agentic OS)
R 🪵 Reasoning R1-R3 (Prompts, RAG, Deterministic AI)
O_ORCH 🌿 Orchestration O1-O3 (Semantic Kernel, Agents, MCP)
O_OPS 🏗️ Operations O4-O6 (Platform, Infrastructure, Copilot)
T 🍎 Transformation T1-T3 (Fine-Tuning, Responsible AI, Production)

Links

License

MIT — Pavleen Bali

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

frootai-3.3.0.tar.gz (238.1 kB view details)

Uploaded Source

Built Distribution

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

frootai-3.3.0-py3-none-any.whl (239.3 kB view details)

Uploaded Python 3

File details

Details for the file frootai-3.3.0.tar.gz.

File metadata

  • Download URL: frootai-3.3.0.tar.gz
  • Upload date:
  • Size: 238.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for frootai-3.3.0.tar.gz
Algorithm Hash digest
SHA256 538b522a5feccab69d416120b28727f9fbed7dc38b9c03b15157eb6a72675440
MD5 510324c31d7c6f8fe9094513d86faf13
BLAKE2b-256 a3abaafa6a70ddfa063d29af37bd6f2a9e379be2fcc7726d23d273d7929b317e

See more details on using hashes here.

File details

Details for the file frootai-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: frootai-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 239.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for frootai-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9dd2dd3a9e1ca006f557c80b9324b2824455f8f37335ece1e2187349ed76998d
MD5 694b2749151ba2c70da2a1344bc43370
BLAKE2b-256 d420356f27c04a9a4d20c66113ede44b8a487a113f373caa7c0e2ec75fe38647

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