๐งโโ๏ธ Summoning CellMageยถ
โจ Magical Requirementsยถ
Before you can summon the CellMage to assist you, ensure you have the following magical components:
๐ Python 3.8 or later
๐ฎ Jupyter Notebook or JupyterLab environment
๐ An API key for your chosen LLM service (e.g., OpenAI)
๐ช Quick Installation Spellยถ
The simplest way to install CellMage is through the mystical PyPI repository:
pip install cellmage
๐งช Optional Potion Ingredientsยถ
CellMage offers various magical extensions to enhance your experience. Install them with:
# For all integrations (recommended for wizards who want the full experience)
pip install "cellmage[all]"
# For specific integrations
pip install "cellmage[github]" # GitHub integration
pip install "cellmage[gitlab]" # GitLab integration
pip install "cellmage[jira]" # Jira integration
pip install "cellmage[confluence]" # Confluence integration
pip install "cellmage[langchain]" # LangChain adapter support
๐งฉ Developer Enchantmentsยถ
If youโre a wizard looking to contribute to CellMage:
# Clone the repository
git clone https://github.com/madpin/cellmage.git
cd cellmage
# Create a magical environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install for development
pip install -e ".[dev,all]"
โก Configuration Charmยถ
๐ Essential API Keysยถ
CellMage requires an API key to communicate with your LLM service provider. This is the most important configuration step:
# Using environment variables (recommended for security)
export CELLMAGE_API_KEY="your_openai_api_key"
# OR use OPENAI_API_KEY if you prefer
export OPENAI_API_KEY="your_openai_api_key"
๐ Using .env Filesยถ
CellMage automatically reads from a .env file in your working directory, which is a convenient way to set configuration without exposing sensitive information:
# Create a .env file with your configuration
cat > .env << EOF
# Essential configuration
CELLMAGE_API_KEY=your_openai_api_key
CELLMAGE_DEFAULT_MODEL=gpt-4o
CELLMAGE_API_BASE=https://api.openai.com/v1
# Optional: Storage configuration
CELLMAGE_SQLITE_PATH=~/.cellmage/conversations.db
CELLMAGE_PERSONAS_DIRS=~/my_personas,./project_personas
CELLMAGE_SNIPPETS_DIRS=~/my_snippets,./project_snippets
EOF
๐ฎ Environment Variables Referenceยถ
Essential Variablesยถ
Environment Variable |
Description |
Default Value |
|---|---|---|
|
Your LLM API key |
None (Required) |
|
API base URL |
https://api.openai.com/v1 |
|
Default model to use |
gpt-4o-mini |
Storage Variablesยถ
Environment Variable |
Description |
Default Value |
|---|---|---|
|
Comma-separated list of directories containing personas |
./llm_personas |
|
Comma-separated list of directories containing snippets |
./llm_snippets |
|
Directory for saving conversations |
./llm_conversations |
|
Path to SQLite database |
~/.cellmage/conversations.db |
|
LLM adapter type (direct or langchain) |
direct |
|
Storage type to use (sqlite, memory, file) |
sqlite |
Integration Variablesยถ
Service |
Required Environment Variables |
|---|---|
Jira |
|
Confluence |
|
GitHub |
|
GitLab |
|
Google Docs |
|
๐ Model Aliasingยถ
CellMage supports model aliasing to create shortcuts for model names. You can define aliases in a cellmage_models.yml file in your working directory:
# Example cellmage_models.yml
mappings:
gpt4: gpt-4o
gpt4-mini: gpt-4o-mini
gpt3: gpt-3.5-turbo
A reference example can be found in cellmage/examples/cellmage_models.yml. This allows you to use shorter aliases like %llm_config --model gpt4 instead of full model names.
๐ช Your First Incantationยถ
Letโs verify that your CellMage installation is working properly:
# In your Jupyter Notebook
%load_ext cellmage
# Check status
%llm_config --status
# Cast your first spell!
%%llm
Tell me a fun fact about wizards in computing history.
If your spell works, congratulations! Youโre now ready to explore the full magical potential of CellMage.
๐ฉโจ Let the wizardry begin! โจ๐ฉ