A flexible AI library with modular provider support
Project description
PepperPy AI
A flexible AI library with modular provider support.
Features
- Multiple AI provider support (OpenAI, Anthropic, StackSpot, OpenRouter)
- Modular capabilities (RAG, Chat, Embeddings)
- Plug-and-play architecture
- Async-first design
- Type-safe with comprehensive type hints
- Extensive test coverage
- Well-documented API
Installation
You can install PepperPy AI with pip:
pip install pepperpy-ai
Optional Dependencies
PepperPy AI uses Poetry's extras feature to manage optional dependencies. You can install specific providers or capabilities:
# Install with OpenAI support
pip install "pepperpy-ai[openai]"
# Install with Anthropic support
pip install "pepperpy-ai[anthropic]"
# Install with RAG support
pip install "pepperpy-ai[rag]"
# Install with all capabilities
pip install "pepperpy-ai[all-capabilities]"
# Install with all providers
pip install "pepperpy-ai[all-providers]"
# Install complete package with all features
pip install "pepperpy-ai[complete]"
Usage
Here's a simple example using the OpenAI provider:
from pepperpy_ai import AIClient
from pepperpy_ai.providers import OpenAIProvider
# Initialize the client with OpenAI provider
client = AIClient(
provider=OpenAIProvider(
api_key="your-api-key",
model="gpt-4-turbo-preview"
)
)
# Use the chat capability
chat = await client.get_capability("chat")
response = await chat.send_message("Hello, how are you?")
print(response.content)
Using RAG capabilities:
from pepperpy_ai import AIClient
from pepperpy_ai.providers import OpenAIProvider
from pepperpy_ai.capabilities.rag import Document
# Initialize the client
client = AIClient(
provider=OpenAIProvider(
api_key="your-api-key",
model="gpt-4-turbo-preview"
)
)
# Get RAG capability
rag = await client.get_capability("rag")
# Add documents
docs = [
Document(
content="PepperPy is a flexible AI library.",
metadata={"source": "readme"}
),
Document(
content="It supports multiple AI providers.",
metadata={"source": "docs"}
)
]
await rag.add_documents(docs)
# Generate response with context
response = await rag.generate("What is PepperPy?")
print(response.content)
Development
Setup
- Clone the repository:
git clone https://github.com/pimentel/pepperpy-ai.git
cd pepperpy-ai
- Install development environment:
./scripts/setup.sh
- Activate virtual environment:
poetry shell
Quality Checks
Run all quality checks:
./scripts/check.sh
This includes:
- Code formatting (black, isort)
- Linting (ruff)
- Type checking (mypy)
- Security checks (bandit)
- Tests (pytest)
Clean
Remove temporary files and build artifacts:
./scripts/clean.sh
Publishing
To publish a new version:
./scripts/publish.sh VERSION
Replace VERSION with the new version number (e.g., 1.0.0).
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run quality checks
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 pepperpy_ai-0.1.0.tar.gz.
File metadata
- Download URL: pepperpy_ai-0.1.0.tar.gz
- Upload date:
- Size: 36.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.12.8 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5b9fe314af0b9cba4bceb2f5e9af8a32f512a3db62c86016cb9c43dc3b0babb
|
|
| MD5 |
388019008b9c48c1eed0809fc29b93e3
|
|
| BLAKE2b-256 |
e1054a4a43ab702882d5c2c0ad34b403b37b8ff157e158614411fc076a64b83b
|
File details
Details for the file pepperpy_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pepperpy_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 93.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.12.8 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb9eaf278a6ad34bb2669bb97ed35d5f0173c8d4ce78f1f021b6ffefa0def12c
|
|
| MD5 |
85eee2ebe8e371380de88d047224736b
|
|
| BLAKE2b-256 |
b2588a55bbf2e298584e40e0e79f9dcd45603104147aa35436d957ec4b9bf87f
|