Unified toolkit for managing and using multiple LLM providers with automatic model detection
Project description
๐ beanllm
Production-ready LLM toolkit with Clean Architecture and unified interface for multiple providers
beanllm is a comprehensive, production-ready toolkit for building LLM applications with a unified interface across OpenAI, Anthropic, Google, DeepSeek, Perplexity, and Ollama. Built with Clean Architecture and SOLID principles.
๐ Documentation
- ๐ก Examples - 20+ working examples
- ๐ฆ PyPI Package - Installation and releases
- ๐ Playground - Full-stack Chat UI
- Backend: FastAPI + Agentic Chat (์๋ Intent ๋ถ๋ฅ), ์ธ์ ๋ณ RAG, Redis ์บ์ฑ
- Frontend: Next.js 15 + React 19, Settings, Monitoring Dashboard
โจ Features Overview
Core Modules (100% Complete)
| Module | Status | Highlights |
|---|---|---|
| LLM Providers | โ 100% | 7 providers (OpenAI, Claude, Gemini, DeepSeek, Perplexity, Ollama) |
| RAG Pipeline | โ 100% | Document loaders, vector stores, hybrid search, rerankers |
| Embeddings | โ 100% | 11 providers, Matryoshka, Code embeddings |
| Retrieval | โ 100% | HyDE, MultiQuery, ColBERT, ColPali, 5 rerankers |
| Evaluation | โ 99% | RAGAS, DeepEval, TruLens, Human-in-the-loop |
| Vision | โ 100% | SAM3, YOLOv12, Florence-2, Qwen3-VL |
| Audio | โ 100% | 8 STT engines (Whisper, SenseVoice, Granite) |
| OCR | โ 100% | 11 engines (PaddleOCR, Qwen2-VL, DeepSeek) |
| Optimizer | โ 100% | Parameter search, benchmarking, A/B testing |
| Multi-Agent | โ 100% | Sequential, parallel, hierarchical, debate |
| Orchestrator | โ 100% | 10 node types, workflow graph, visual builder |
| Knowledge Graph | โ 100% | Multi NER engines, relation extraction, GraphRAG |
Key Capabilities
- ๐ Unified Interface - Single API for 7 LLM providers
- ๐๏ธ Smart Parameter Adaptation - Auto-convert between providers
- ๐ Advanced PDF Processing - 3-layer architecture (Fast/Accurate/ML)
- ๐๏ธ 8 Vector Stores - Chroma, FAISS, Pinecone, Qdrant, Weaviate, Milvus, LanceDB, pgvector
- ๐ธ๏ธ Graph Workflows - LangGraph-style DAG execution
- ๐ก๏ธ Production Ready - Retry, circuit breaker, rate limiting, tracing
๐ฆ Installation
# Basic installation
pip install beanllm
# With specific providers
pip install beanllm[openai,anthropic,gemini]
# Full installation
pip install beanllm[all]
# Development
pip install beanllm[dev,all]
Using Poetry
git clone https://github.com/leebeanbin/beanllm.git
cd beanllm
poetry install --extras all
๐ Quick Start
Environment Setup
# .env file
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
OLLAMA_HOST=http://localhost:11434
๐ฌ Basic Chat
import asyncio
from beanllm import Client
async def main():
client = Client(model="gpt-4o")
response = await client.chat(
messages=[{"role": "user", "content": "Explain quantum computing"}]
)
print(response.content)
# Streaming
async for chunk in client.stream_chat(
messages=[{"role": "user", "content": "Tell me a story"}]
):
print(chunk, end="", flush=True)
asyncio.run(main())
๐ RAG in One Line
from beanllm import RAGChain
async def main():
rag = RAGChain.from_documents("docs/")
result = await rag.query("What is this about?", include_sources=True)
print(result.answer)
asyncio.run(main())
๐ ๏ธ Tools & Agents
from beanllm import Agent, Tool
@Tool.from_function
def calculator(expression: str) -> str:
"""Evaluate a math expression"""
return str(eval(expression))
agent = Agent(model="gpt-4o-mini", tools=[calculator])
result = await agent.run("What is 25 * 17?")
๐ธ๏ธ Graph Workflows
from beanllm import StateGraph
graph = StateGraph()
graph.add_node("analyze", analyze_fn)
graph.add_node("improve", improve_fn)
graph.add_conditional_edges("analyze", decide, {"good": "END", "bad": "improve"})
graph.set_entry_point("analyze")
result = await graph.invoke({"input": "Draft proposal"})
๐ฏ Model Support
LLM Providers
- OpenAI: GPT-5, GPT-4o, GPT-4.1, GPT-4o-mini
- Anthropic: Claude Opus 4, Claude Sonnet 4.5
- Google: Gemini 2.5 Pro/Flash
- DeepSeek: DeepSeek-V3 (671B MoE)
- Perplexity: Sonar (real-time web search)
- Ollama: Local LLM support
Vision Models
- SAM 3 (zero-shot segmentation)
- YOLOv12 (object detection)
- Qwen3-VL, Florence-2
Audio (8 STT Engines)
- SenseVoice-Small (15x faster, emotion recognition)
- Granite Speech 8B (WER 5.85%)
- Whisper V3 Turbo, Distil-Whisper, Parakeet, Canary, Moonshine
Embeddings
- Qwen3-Embedding-8B (multilingual)
- OpenAI text-embedding-3
- Code embeddings, CLIP/SigLIP
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Facade Layer โ
โ User-friendly API (Client, RAGChain, Agent) โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Handler Layer โ
โ Input validation, error handling โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Service Layer โ
โ Business logic (interfaces + implementations) โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Domain Layer โ
โ Core business (entities, rules) โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Infrastructure Layer โ
โ External systems (providers, vector stores) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง CLI
beanllm list # List available models
beanllm show gpt-4o # Show model details
beanllm providers # Check providers
beanllm summary # Quick summary
๐งช Testing
pytest # Run all tests
pytest --cov=src/beanllm --cov-report=html # With coverage
make quality # Full quality check (Ruff, mypy, Bandit, pytest)
๐ ๏ธ Development
# Install dev dependencies
pip install -e ".[dev,all]"
# Setup pre-commit hooks
make pre-commit
# Code quality
make quick-fix # Auto-fix with Black, Ruff
make type-check # MyPy type checking
make lint # Ruff linting
๐ License
MIT License - see LICENSE file.
๐ Acknowledgments
- LangChain - LLM framework inspiration
- LangGraph - Graph workflow patterns
- OpenAI, Anthropic, Google, DeepSeek teams
๐ง Contact
Built with โค๏ธ for the LLM community
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beanllm-0.3.0.tar.gz.
File metadata
- Download URL: beanllm-0.3.0.tar.gz
- Upload date:
- Size: 733.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fb2d8a40b1301f71df0fdf2dc48ae57085715a6b04615a8447e2d9f7f6f5de1
|
|
| MD5 |
92e431555719b64f51f8aac2c43f4223
|
|
| BLAKE2b-256 |
248eae7700c4bacebf5cdd63ab9d49837d3096de9fad90342eb58ba51f50f0e5
|
File details
Details for the file beanllm-0.3.0-py3-none-any.whl.
File metadata
- Download URL: beanllm-0.3.0-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b9bc4b440e4dbef69e875b3122b4ff0841c3c262f3586872d01537081ee1426
|
|
| MD5 |
b197a6b50e63f5bbb6434156811252fb
|
|
| BLAKE2b-256 |
aa40def62305f81f6c1c2f04098f1541b24d732f4b054a19b2dcd128c7cbd665
|