Skip to main content

bbi-bucky

Pluggable AI chatbot framework for enterprise applications. Drop a YAML config and three lines of Python to add an AI assistant to any FastAPI app.

Install

# Core only (config, contracts, agent pipeline)
pip install bbi-bucky

# With AWS Bedrock (Claude)
pip install bbi-bucky[bedrock]

# With Snowflake Cortex
pip install bbi-bucky[cortex]

# With FastAPI router factory
pip install bbi-bucky[api]

# With RAG (ChromaDB)
pip install bbi-bucky[chromadb]

# YAML config loading
pip install bbi-bucky[yaml]        # PyYAML
pip install bbi-bucky[ruamel]      # ruamel.yaml

# Everything
pip install bbi-bucky[all]

Quick start

1. Create a config file (bucky.yaml):

app_name: "My App Assistant"
llm:
  provider: "bedrock"
  model: "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
  temperature: 0.7
  max_tokens: 4096
  aws_region: "us-east-1"
agent:
  max_history: 10
  system_prompt_override: |
    You are a helpful assistant for My App.

2. Wire it up (3 lines):

from bbi_bucky import create_chat_router, load_config

config = load_config(yaml_path="bucky.yaml")
app.include_router(create_chat_router(config=config))

This gives you /api/bucky/chat, /api/bucky/chat/stream (SSE), and /api/bucky/health out of the box.

3. Or use the LLM service directly:

from bbi_bucky import load_config
from bbi_bucky.llm.unified import UnifiedLLMService

config = load_config(yaml_path="bucky.yaml")
llm = UnifiedLLMService(config.llm)

# Non-streaming
response = await llm.invoke("What is Kubernetes?", system_prompt="Be concise.")

# Streaming
async for chunk in llm.stream("Explain microservices"):
    print(chunk, end="")

Configuration

All config is loaded from YAML, with environment variable overrides and code overrides layered on top.

config = load_config(
    yaml_path="bucky.yaml",          # YAML file (optional)
    env_prefix="BBI_BUCKY_",         # Env var prefix (e.g. BBI_BUCKY_LLM_PROVIDER=cortex)
    overrides={"llm": {"model": "llama3.1-70b"}},  # Code overrides (highest priority)
)

Priority: YAML < environment variables < code overrides.

LLM Providers

AWS Bedrock (Claude)

pip install bbi-bucky[bedrock]

Uses the Bedrock Converse API. Supports streaming. Credentials from environment or explicit config.

Snowflake Cortex

pip install bbi-bucky[cortex]

REST API with SSE streaming. SPCS-compatible (auto-detects /snowflake/session/token).

Custom providers

from bbi_bucky.llm.factory import LLMFactory

LLMFactory.register("my_provider", MyCustomProvider)

Your provider just needs generate() and stream() methods matching the LLMProvider protocol.

Features

  • Zero-config defaults: Only pydantic is required. Everything else is optional.
  • YAML + env var config: Single source of truth, overridable per-environment.
  • Multiple LLM providers: Bedrock and Cortex built-in, custom providers via register().
  • SSE streaming: Named events (response.text.delta, activity.started, etc.).
  • Agent pipeline: Intent classification, context gathering, RAG retrieval, response generation.
  • RAG support: ChromaDB backend included, or bring your own via IRAGService.
  • Conversation memory: In-memory by default, extensible via IConversationMemory.
  • API contracts: ApiResponseEnvelope on all endpoints (RFC 9457 errors).
  • Router factory: create_chat_router() gives you a full FastAPI router in one call.

Requirements

  • Python 3.11+
  • pydantic >= 2.0 (only hard dependency)

License

MIT

Metadata

Release files for bbi-bucky 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bbi-bucky 1.0.0
File Size Uploaded
bbi_bucky-1.0.0.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bbi-bucky 1.0.0
File Interpreter ABI Platform
bbi_bucky-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.9 kB

Release files / bbi_bucky-1.0.0.tar.gz

Download URL bbi_bucky-1.0.0.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eb71dabed5045062422664a0f989b55f8627737163b13e450d59418896c5444f
BLAKE2b-256 checksum
How to use checksums
f766537765f883487784954bd5e79bdd5d50f04177947efcae6b75eb9c6fed44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / bbi_bucky-1.0.0-py3-none-any.whl

Download URL bbi_bucky-1.0.0-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c152fb09279e98e5f7a19940ef8fad1a1a30461b5e7fefff325aed558545754
BLAKE2b-256 checksum
How to use checksums
c3b0deba1369b1903c1be2d0602718543d80e6fbf44d9b561575be82cd079555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page