Skip to main content

Evolutionary Local LLM Agent - Self-improving AI assistant

Project description

๐Ÿงฌ ELLMa - Evolutionary Local LLM Agent

Evolutionary Local LLM Agent - Self-improving AI assistant that evolves with your needs

PyPI version Python Support License: MIT Code style: black Documentation Status

๐Ÿ“‹ Table of Contents

๐Ÿš€ Features

ELLMa is a revolutionary self-evolving AI agent that runs locally on your machine. Unlike traditional AI tools, ELLMa learns and improves itself with these key features:

PyPI version Python Support License: MIT Code style: black

๐Ÿš€ What is ELLMa?

ELLMa is a revolutionary self-evolving AI agent that runs locally on your machine. Unlike traditional AI tools, ELLMa learns and improves itself by:

Core Capabilities

  • ๐Ÿงฌ Self-Evolution: Automatically generates new capabilities based on usage patterns
  • ๐Ÿ  Local-First: Runs entirely on your machine with complete privacy
  • ๐Ÿš Shell-Native: Integrates seamlessly with your system and workflows
  • ๐Ÿ› ๏ธ Command Execution: Executes commands in a structured format
  • ๐Ÿ“ฆ Modular: Extensible architecture that grows with your needs
  • ๐Ÿค– Multi-Model: Supports various local LLM models
  • ๐Ÿ”„ Auto-Improving: Continuously learns from interactions

Technical Highlights

  • Built-in Commands: Wide range of system, web, and file operations
  • Code Generation: Generate Python, Bash, and Docker configurations
  • Web Interaction: Advanced web scraping and API interaction tools
  • Plugin System: Easy to extend with custom modules
  • Performance Monitoring: Built-in metrics and monitoring
  • Cross-Platform: Works on Linux, macOS, and Windows (WSL2 recommended for Windows)

โšก Quick Start

Prerequisites

  • Python 3.8+
  • pip (Python package manager)
  • Git (for development)
  • 8GB+ RAM recommended for local models
  • For GPU acceleration: CUDA-compatible GPU (optional)

Installation

Option 1: Install from source (recommended for development)

# Clone the repository
git clone https://github.com/wronai/ellma.git
cd ellma

# Install in development mode with all dependencies
pip install -e ".[dev]"

Option 2: Install via pip

pip install ellma

First Steps

  1. Initialize ELLMa (creates config in ~/.ellma)

    # Basic initialization
    ellma init
    
    # Force re-initialization
    # ellma init --force
    
  2. Download a model (or let it auto-download when needed)

    # Download default model
    ellma download-model
    
    # Specify a different model
    # ellma download-model --model mistral-7b-instruct
    
  3. Verify your setup

    # Check system requirements and configuration
    ellma verify
    
  4. Start the interactive shell

    # Start interactive shell
    ellma shell
    
    # Start shell with verbose output
    # ellma -v shell
    
  5. Or execute commands directly

    # System information
    ellma exec system.scan
    
    # Web interaction (extract text and links)
    ellma exec web.read https://example.com --extract-text --extract-links
    
    # File operations (search for Python files)
    ellma exec files.search /path/to/directory --pattern "*.py"
    
    # Get agent status
    ellma status
    

๐Ÿ›  Development

๐Ÿ›  Development

Setting Up Development Environment

  1. Clone the repository

    git clone https://github.com/wronai/ellma.git
    cd ellma
    
  2. Install with development dependencies

    pip install -e ".[dev]"
    
  3. Set up pre-commit hooks (recommended)

    pre-commit install
    

Development Workflow

Running Tests

# Run all tests
make test

# Run specific test file
pytest tests/test_web_commands.py -v

# Run with coverage report
make test-coverage

Code Quality

# Run linters
make lint

# Auto-format code
make format

# Type checking
make typecheck

# Security checks
make security

Documentation

# Build documentation
make docs

# Serve docs locally
cd docs && python -m http.server 8000

Project Structure

ellma/
โ”œโ”€โ”€ ellma/                  # Main package
โ”‚   โ”œโ”€โ”€ core/              # Core functionality
โ”‚   โ”œโ”€โ”€ commands/          # Built-in commands
โ”‚   โ”œโ”€โ”€ generators/        # Code generation
โ”‚   โ”œโ”€โ”€ models/           # Model management
โ”‚   โ””โ”€โ”€ utils/            # Utilities
โ”œโ”€โ”€ tests/                 # Test suite
โ”œโ”€โ”€ docs/                 # Documentation
โ””โ”€โ”€ scripts/              # Development scripts

Project Structure

ellma/
โ”œโ”€โ”€ ellma/                  # Main package
โ”‚   โ”œโ”€โ”€ core/              # Core functionality
โ”‚   โ”œโ”€โ”€ commands/          # Built-in commands
โ”‚   โ”œโ”€โ”€ generators/        # Code generation
โ”‚   โ”œโ”€โ”€ models/           # Model management
โ”‚   โ””โ”€โ”€ utils/            # Utilities
โ”œโ”€โ”€ tests/                 # Test suite
โ”œโ”€โ”€ docs/                 # Documentation
โ””โ”€โ”€ scripts/              # Development scripts

๐Ÿ”„ Evolution & Self-Improvement

ELLMa's evolution engine allows it to analyze its performance and automatically improve its capabilities.

Running Evolution

# Run a single evolution cycle
ellma evolve

# Run multiple evolution cycles
ellma evolve --cycles 3

# Force evolution even if no improvements are detected
ellma evolve --force

# Run evolution with specific parameters
ellma evolve --learning-rate 0.2 --max-depth 5

Monitoring Evolution

# View evolution history
cat ~/.ellma/evolution/evolution_history.json | jq .

# Monitor evolution logs
tail -f ~/.ellma/logs/evolution.log

# Get evolution status
ellma status --evolution

Evolution Configuration

You can configure the evolution process in ~/.ellma/config.yaml:

evolution:
  enabled: true
  auto_improve: true
  learning_rate: 0.1
  max_depth: 3
  max_iterations: 100
  early_stopping: true

๐Ÿงฉ Extending ELLMa

Creating Custom Commands

  1. Create a new Python module in ellma/commands/:
from ellma.commands.base import BaseCommand

class MyCustomCommand(BaseCommand):
    """My custom command"""
  1. Register your command in ellma/commands/__init__.py
  2. Restart ELLMa to load your new command

โš™๏ธ Generated Utilities

ELLMa includes a powerful set of self-generated utilities for common programming tasks. These include:

  • ๐Ÿ›ก๏ธ Enhanced Error Handling: Automatic retries with exponential backoff
  • โšก Performance Caching: In-memory cache with TTL support
  • ๐Ÿš€ Parallel Processing: Easy parallel execution of tasks

See the Generated Utilities Documentation for detailed usage and examples.

def __init__(self, agent):
    super().__init__(agent)
    self.name = "custom"
    self.description = "My custom command"

def my_action(self, param1: str, param2: int = 42):
    """Example action"""
    return {"result": f"Got {param1} and {param2}"}

2. Register your command in `ellma/commands/__init__.py`

### Creating Custom Modules

1. Create a new module class:

```python
from ellma.core.module import BaseModule

class MyCustomModule(BaseModule):
    def __init__(self, agent):
        super().__init__(agent)
        self.name = "my_module"
        self.version = "1.0.0"
    
    def setup(self):
        # Initialization code
        pass
    
    def execute(self, command: str, *args, **kwargs):
        # Handle commands
        if command == "greet":
            return f"Hello, {kwargs.get('name', 'World')}!"
        raise ValueError(f"Unknown command: {command}")
  1. Register your module in the agent's configuration

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Report Bugs: Open an issue with detailed steps to reproduce
  2. Suggest Features: Share your ideas for new features
  3. Submit Pull Requests: Follow these steps:
    • Fork the repository
    • Create a feature branch
    • Make your changes
    • Add tests
    • Update documentation
    • Submit a PR

Development Guidelines

  • Follow PEP 8 style guide
  • Write docstrings for all public functions and classes
  • Add type hints for better code clarity
  • Write tests for new features
  • Update documentation when making changes

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ“š Documentation

For complete documentation, visit ellma.readthedocs.io

๐Ÿ™ Acknowledgments

  • Thanks to all contributors who have helped improve ELLMa
  • Built with โค๏ธ by the ELLMa team

๐ŸŽฏ Core Features

๐Ÿงฌ Self-Evolution Engine

ELLMa continuously improves by analyzing its performance and automatically generating new modules:

$ ellma evolve
๐Ÿงฌ Starting evolution process...
๐Ÿ“Š Analyzing current capabilities...
๐ŸŽฏ Identified 3 improvement opportunities:
   โœ… Added: advanced_file_analyzer
   โœ… Added: network_monitoring
   โœ… Added: code_optimizer
๐ŸŽ‰ Evolution complete! 3 new capabilities added.

๐Ÿ“Š Performance Monitoring

Track your agent's performance:

# Show agent status
ellma status

# View system health metrics
ellma exec system.health

๐Ÿ” Advanced Command Usage

# Chain multiple commands
ellma exec "system.scan && web.read https://example.com"

# Save command output to file
ellma exec system.scan > scan_results.json

# Use different output formats
ellma exec system.scan --format json
ellma exec system.scan --format yaml

๐Ÿš Powerful Shell Interface

Natural language commands that translate to system operations:

ellma> system scan network ports
ellma> generate bash script for backup
ellma> analyze this log file for errors
ellma> create docker setup for web app

๐Ÿ› ๏ธ Multi-Language Code Generation

Generate production-ready code in multiple languages:

# Generate Bash scripts
ellma generate bash --task="Monitor system resources and alert on high usage"

# Generate Python code  
ellma generate python --task="Web scraper with rate limiting"

# Generate Docker configurations
ellma generate docker --task="Multi-service web application"

# Generate Groovy for Jenkins
ellma generate groovy --task="CI/CD pipeline with testing stages"

๐Ÿ“Š Intelligent System Integration

ELLMa understands your system and can:

  • Scan and analyze system configurations
  • Monitor processes and resources
  • Automate repetitive tasks
  • Generate custom tools for your workflow

๐Ÿ—๏ธ Architecture

ellma/
โ”œโ”€โ”€ core/                   # Core agent and evolution engine
โ”‚   โ”œโ”€โ”€ agent.py           # Main LLM Agent class
โ”‚   โ”œโ”€โ”€ evolution.py       # Self-improvement system
โ”‚   โ””โ”€โ”€ shell.py           # Interactive shell interface
โ”œโ”€โ”€ commands/               # Modular command system
โ”‚   โ”œโ”€โ”€ system.py          # System operations
โ”‚   โ”œโ”€โ”€ web.py             # Web interactions
โ”‚   โ””โ”€โ”€ files.py           # File operations
โ”œโ”€โ”€ generators/             # Code generation engines
โ”‚   โ”œโ”€โ”€ bash.py            # Bash script generator
โ”‚   โ”œโ”€โ”€ python.py          # Python code generator
โ”‚   โ””โ”€โ”€ docker.py          # Docker configuration generator
โ”œโ”€โ”€ modules/                # Dynamic module system
โ”‚   โ”œโ”€โ”€ registry.py        # Module registry and loader
โ”‚   โ””โ”€โ”€ [auto-generated]/  # Self-created modules
โ””โ”€โ”€ cli/                   # Command-line interface
    โ”œโ”€โ”€ main.py            # Main CLI entry point
    โ””โ”€โ”€ shell.py           # Interactive shell

๐Ÿ“š Usage Examples

System Administration

# Run comprehensive system scan
ellma exec system.scan

# Monitor system resources (60 seconds with 5-second intervals)
ellma exec system.monitor --duration 60 --interval 5

# Check system health status
ellma exec system.health

# List top processes by CPU usage
ellma exec system.processes --sort-by cpu --limit 10

# Check open network ports
ellma exec system.ports

Development Workflow

# Generate a new Python project
ellma generate python --task "FastAPI project with SQLAlchemy and JWT auth"

# Create a Docker Compose setup
ellma generate docker --task "Python app with PostgreSQL and Redis"

# Generate test cases
ellma generate test --file app/main.py --framework pytest

# Document a Python function
ellma exec code.document_function utils.py --function process_data

Web & API Interaction

# Read and extract content from a webpage
ellma exec web.read https://example.com --extract-text --extract-links

# Make HTTP GET request to an API endpoint
ellma exec web.get https://api.example.com/data

# Make HTTP POST request with JSON data
ellma exec web.post https://api.example.com/data --data '{"key": "value"}'

# Generate API client code
ellma generate python --task "API client for REST service with error handling"

## ๐Ÿ”ง Configuration

ELLMa stores its configuration in `~/.ellma/`:

```yaml
# ~/.ellma/config.yaml
model:
  path: ~/.ellma/models/mistral-7b.gguf
  context_length: 4096
  temperature: 0.7

evolution:
  enabled: true
  auto_improve: true
  learning_rate: 0.1

modules:
  auto_load: true
  custom_path: ~/.ellma/modules

๐Ÿงฌ How Evolution Works

  1. Performance Analysis: ELLMa monitors execution times, success rates, and user feedback
  2. Gap Identification: Identifies missing functionality or optimization opportunities
  3. Code Generation: Uses its LLM to generate new modules and improvements
  4. Testing & Integration: Automatically tests and integrates new capabilities
  5. Continuous Learning: Learns from each interaction to become more useful

๐Ÿš€ Advanced Features

Custom Module Development

# Create custom modules that ELLMa can use and improve
from ellma.core.module import BaseModule

class MyCustomModule(BaseModule):
    def execute(self, *args, **kwargs):
        # Your custom functionality
        return result

API Integration

from ellma import ELLMa

# Use ELLMa programmatically
agent = ELLMa()
result = agent.execute("system.scan")
code = agent.generate("python", task="Data analysis script")

Web Interface (Optional)

# Install web dependencies
pip install ellma[web]

# Start web interface
ellma web --port 8000

๐Ÿ›ฃ๏ธ Roadmap

Version 0.1.6 - MVP โœ…

  • Core agent with Mistral 7B
  • Basic command system
  • Shell interface
  • Evolution foundation

Version 0.2.0 - Enhanced Shell

  • Advanced command completion
  • Command history and favorites
  • Real-time performance monitoring
  • Module hot-reloading

Version 0.3.0 - Code Generation

  • Multi-language code generators
  • Template system
  • Code quality analysis
  • Integration testing

Version 0.4.0 - Advanced Evolution

  • Performance-based learning
  • User feedback integration
  • Predictive capability development
  • Module marketplace

Version 1.0.0 - Autonomous Agent

  • Full self-management
  • Advanced reasoning capabilities
  • Multi-agent coordination
  • Enterprise features

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone repository
git clone https://github.com/ellma-ai/ellma.git
cd ellma

# Install in development mode
pip install -e .[dev]

# Run tests
pytest

# Run linting
black ellma/
flake8 ellma/

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built on top of llama-cpp-python
  • Inspired by the vision of autonomous AI agents
  • Powered by the amazing Mistral 7B model

๐Ÿ“ž Support


ELLMa: The AI agent that grows with you ๐ŸŒฑโ†’๐ŸŒณ

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

ellma-0.1.9.tar.gz (103.3 kB view details)

Uploaded Source

Built Distribution

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

ellma-0.1.9-py3-none-any.whl (114.2 kB view details)

Uploaded Python 3

File details

Details for the file ellma-0.1.9.tar.gz.

File metadata

  • Download URL: ellma-0.1.9.tar.gz
  • Upload date:
  • Size: 103.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.4 Linux/6.14.9-300.fc42.x86_64

File hashes

Hashes for ellma-0.1.9.tar.gz
Algorithm Hash digest
SHA256 68f2c4bca7dcff29da49d09a5a873cf9145c9c0a0d2fa34d5b93126d55d5c243
MD5 7929bc1d54f3abbd9576a8884c42d055
BLAKE2b-256 8ba889a4b44e20eb0b3fb1ef8b0705f2ae8d1a6ef2897f3ce148f380d570f258

See more details on using hashes here.

File details

Details for the file ellma-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: ellma-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 114.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.4 Linux/6.14.9-300.fc42.x86_64

File hashes

Hashes for ellma-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 748cebbad1ec7ec59ae3aff13a747b282f1c621fa50c78939bd1f0ff3454c83d
MD5 9ad0d5a1708c5d07844820a834ba2d39
BLAKE2b-256 4360339414c5ce780f7841e7f9ae9cc3a06543aafbd3007aaf353804d74a22a9

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