Skip to main content

A flexible, multi-LLM, agent-oriented Python library with self-reflection capabilities

Project description

shaheenai

ShaheenAI is a flexible, multi-LLM, agent-oriented Python library that supports multiple language model providers like OpenAI, Anthropic, Ollama, and Cohere via a plugin/extras architecture. The library offers self-reflection, tool invocation, task chaining, and optional UI integrations using Streamlit and Chainlit.

Features

  • Modular Agent Class: Supports multiple LLMs with self-reflection, tool invocation, and task chaining.
  • MCP Server Interface: Optionally integrates tools and external APIs.
  • Configurable via YAML or Code: Supports playbooks and programmatic configuration.
  • Wide LLM Provider Support: OpenAI, Anthropic, Ollama, Cohere, etc.
  • Streamlit and Chainlit Support: Build interactive and conversational UIs for agents.

Getting Started

Prerequisites

  • Python 3.10 or higher

Installation

To install ShaheenAI, use pip:

pip install shaheenai

Usage

Here's a basic example of how to use ShaheenAI to create an agent that utilizes a weather tool:

from shaheenai.agent import Agent
from shaheenai.mcp import MCP

# Define and run the MCP server
mcp = MCP()
@mcp.tool()
async def get_weather(location: str) -> str:
    return "Sunny with 25°C"

if __name__ == "__main__":
    mcp.run()

# Create an agent
agent = Agent(instructions="You can use tools when needed", llm="openai", tools=["get_weather"])
response = agent.start("What's the weather in Lahore today?")
print(response)

CLI

ShaheenAI provides a command-line interface for running agents defined in YAML playbooks or via auto-mode.

Example:

shaheenai run agents.yaml

Directory Structure

shaheenai/
 ├── shaheenai/
 │    ├── __init__.py
 │    ├── agent.py
 │    ├── mcp.py
 │    ├── llm_providers/
 │    │     ├── openai.py
 │    │     ├── cohere.py
 │    │     └── ...
 │    ├── tools/
 │    └── config.py
 ├── setup.py or pyproject.toml
 ├── README.md
 ├── LICENSE  # e.g. MIT
 └── examples/
      ├── app.py
      └── agents.yaml

Contributing

Contributions are welcome! Please read the contribution guidelines first.

License

This project is licensed under the MIT License.

Acknowledgments

Inspired by PraisonAI for its modularity and multi-LLM support.

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

shaheenai-0.1.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

shaheenai-0.1.1-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file shaheenai-0.1.1.tar.gz.

File metadata

  • Download URL: shaheenai-0.1.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for shaheenai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6ba7111c52ecf8ce667c2f44a83189078e2df791e84443bb483cb16cce3542e9
MD5 a07503a93edde7e58e86abe7394df408
BLAKE2b-256 13ac49416688391a4859007f05d189848e3c034642a537c9d72e264273a528f9

See more details on using hashes here.

File details

Details for the file shaheenai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shaheenai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for shaheenai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e46d62ffd5a67d879ada9d7b002dbabdee5c3c4d8d881e40ebb570bebc9593f8
MD5 1bcd03538fd5651ac6443dba2310df1d
BLAKE2b-256 34fb61bd1c99e5862b6b34696b30a5657e992c8e2ff7dad5079cbbfcf79c7789

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