Installation

Installation guide for our application.

This guide explains how to install the Karo framework for use in your projects.

Prerequisites

  • Python 3.10 or higher
  • pip (Python package installer)

Standard Installation

The recommended way to install Karo is using pip:

pip install karo

This command will download and install the latest stable version of Karo and its core dependencies.

If you’ve installed Karo previously and want to upgrade to the latest version, run:

pip install --upgrade karo

Installing Optional Dependencies

Karo has optional features for serving, document parsing, formatting, and more. These can often be installed as extras if configured, or directly using pip.

  • For Running a Local Server: If you want to deploy Karo with a local FastAPI server:

    pip install karo[serve]
    

    This installs FastAPI, Uvicorn, and related dependencies required to serve Karo with authentication and logging.

  • For Excel Reading: If you plan to use tools that read .xlsx files (like the ExcelReaderTool example), you'll need openpyxl:

    pip install openpyxl
    
  • For Pandas: If using tools requiring pandas:

    pip install pandas
    
  • For Rich Output: If running examples that use rich for formatted terminal output:

    pip install rich
    
  • For PDF/DOCX Reading: Karo includes a DocumentReaderTool. To enable reading from .pdf and .docx files with this tool, you need to install the required libraries:

    pip install pypdf python-docx
    

Environment Variables

Karo requires API keys for certain services, primarily LLM providers and embedding models. The recommended way to manage these is through environment variables.

Create a .env file in the root directory of your project (where you are importing and using Karo) and add the necessary keys:

# Example for OpenAI
OPENAI_API_KEY='your-openai-api-key-here'

# Add other keys as needed for different providers or services
# SOME_OTHER_API_KEY='your-other-key'

Karo components (like OpenAIProvider or ChromaDBService using OpenAI embeddings) will automatically look for these environment variables if the keys are not provided directly during configuration. You can use libraries like python-dotenv in your own application code to load this file:

# In your application script
from dotenv import load_dotenv
load_dotenv()

# Now Karo components can access the environment variables
# ... initialize Karo providers/services ...