Skip to main content

An advanced, highly customizable terminal-based chat application for interacting with LLMs

Project description

Kollabor

Python Version License: MIT

An advanced, highly customizable terminal-based chat application for interacting with Large Language Models (LLMs). Built with a powerful plugin system and comprehensive hook architecture for complete customization.

Install: pip install kollabor Run: kollab

Features

  • Event-Driven Architecture: Everything has hooks - every action triggers customizable hooks that plugins can attach to
  • Advanced Plugin System: Dynamic plugin discovery and loading with comprehensive SDK
  • Rich Terminal UI: Beautiful terminal rendering with status areas, visual effects, and modal overlays
  • Conversation Management: Persistent conversation history with full logging support
  • Model Context Protocol (MCP): Built-in support for MCP integration
  • Tool Execution: Function calling and tool execution capabilities
  • Pipe Mode: Non-interactive mode for scripting and automation
  • Extensible Configuration: Flexible configuration system with plugin integration
  • Async/Await Throughout: Modern Python async patterns for responsive performance

Installation

From PyPI

pip install kollabor

From Source

git clone https://github.com/malmazan/kollabor-cli.git
cd kollabor-cli
pip install -e .

Development Installation

pip install -e ".[dev]"

Quick Start

Interactive Mode

Simply run the CLI to start an interactive chat session:

kollab

Pipe Mode

Process a single query and exit:

# Direct query
kollab "What is the capital of France?"

# From stdin
echo "Explain quantum computing" | kollab -p

# From file
cat document.txt | kollab -p

# With custom timeout
kollab --timeout 5min "Complex analysis task"

Configuration

On first run, Kollabor creates a .kollabor directory in your current working directory:

.kollabor/
├── config.json    # User configuration
├── logs/          # Application logs
└── state.db       # Persistent state

Configuration Options

The configuration system uses dot notation:

  • core.llm.* - LLM service settings
  • terminal.* - Terminal rendering options
  • application.* - Application metadata

Architecture

Kollabor follows a modular, event-driven architecture:

Core Components

  • Application Core (core/application.py): Main orchestrator
  • Event System (core/events/): Central event bus with hook system
  • LLM Services (core/llm/): API communication, conversation management, tool execution
  • I/O System (core/io/): Terminal rendering, input handling, visual effects
  • Plugin System (core/plugins/): Dynamic plugin discovery and loading
  • Configuration (core/config/): Flexible configuration management
  • Storage (core/storage/): State management and persistence

Plugin Development

Create custom plugins by inheriting from base plugin classes:

from core.plugins import BasePlugin
from core.events import EventType

class MyPlugin(BasePlugin):
    def register_hooks(self):
        """Register plugin hooks."""
        self.event_bus.register_hook(
            EventType.PRE_USER_INPUT,
            self.on_user_input,
            priority=HookPriority.NORMAL
        )

    async def on_user_input(self, context):
        """Process user input before it's sent to the LLM."""
        # Your custom logic here
        return context

    def get_status_line(self):
        """Provide status information for the status bar."""
        return "MyPlugin: Active"

Hook System

The comprehensive hook system allows plugins to intercept and modify behavior at every stage:

  • pre_user_input - Before processing user input
  • pre_api_request - Before API calls to LLM
  • post_api_response - After receiving LLM responses
  • pre_message_display - Before displaying messages
  • post_message_display - After displaying messages
  • And many more...

Project Structure

kollabor/
├── core/              # Core application modules
│   ├── application.py # Main orchestrator
│   ├── config/        # Configuration management
│   ├── events/        # Event bus and hooks
│   ├── io/            # Terminal I/O
│   ├── llm/           # LLM services
│   ├── plugins/       # Plugin system
│   └── storage/       # State management
├── plugins/           # Plugin implementations
├── docs/              # Documentation
├── tests/             # Test suite
└── main.py            # Application entry point

Development

Running Tests

# All tests
python tests/run_tests.py

# Specific test file
python -m unittest tests.test_llm_plugin

# Individual test case
python -m unittest tests.test_llm_plugin.TestLLMPlugin.test_thinking_tags_removal

Code Quality

# Format code
python -m black core/ plugins/ tests/ main.py

# Type checking
python -m mypy core/ plugins/

# Linting
python -m flake8 core/ plugins/ tests/ main.py --max-line-length=88

# Clean up cache files and build artifacts
python scripts/clean.py

Requirements

  • Python 3.12 or higher
  • aiohttp 3.8.0 or higher

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please see the documentation for development guidelines.

Links

Acknowledgments

Built with modern Python async/await patterns and designed for extensibility and customization.

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

kollabor-0.3.1.tar.gz (767.8 kB view details)

Uploaded Source

Built Distribution

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

kollabor-0.3.1-py3-none-any.whl (304.0 kB view details)

Uploaded Python 3

File details

Details for the file kollabor-0.3.1.tar.gz.

File metadata

  • Download URL: kollabor-0.3.1.tar.gz
  • Upload date:
  • Size: 767.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f232a4c5ea8dccd8cf0483d734622f6f0df9cd3544f6e3cb2eeb9f6c23ea96fd
MD5 4e78c7eca1487e4547ce91ab1b522164
BLAKE2b-256 061a4761f61fc37a6bf8119bd9cbc715046c0dc6d7889dc477b4ae0893d12815

See more details on using hashes here.

File details

Details for the file kollabor-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: kollabor-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 304.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ee1360351b587dfae2b9a6b803bd65fbf46d0aa83e9ad40c3d69e3522ac016a
MD5 1a40c8daddf2649c915afb7d86e9d406
BLAKE2b-256 44101426fe794d06a1baf9d0a62255c282647e81fdbd0b5d62aa7e5b192ea99d

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