Metadata-Version: 2.4
Name: llama-ctrl
Version: 0.1.0
Summary: Control plane, configuration management, and service coordination for LlamaAI Ecosystem
Project-URL: Homepage, https://github.com/yourusername/llama-ctrl-pkg
Project-URL: Bug Tracker, https://github.com/yourusername/llama-ctrl-pkg/issues
Project-URL: Documentation, https://yourusername.github.io/llama-ctrl-pkg/
Author-email: Your Name <your.email@example.com>
License: MIT License
        
        Copyright (c) 2024 Your Name # Replace with current year and your name/organization
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE. 
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Requires-Dist: fastapi>=0.95.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: loguru>=0.7.0
Requires-Dist: pydantic>=1.10.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: redis[hiredis]>=4.5.0
Requires-Dist: typer[all]>=0.9.0
Requires-Dist: uvicorn[standard]>=0.21.0
Provides-Extra: all
Requires-Dist: black>=23.3.0; extra == 'all'
Requires-Dist: docker>=6.0.0; extra == 'all'
Requires-Dist: httpx; extra == 'all'
Requires-Dist: isort>=5.12.0; extra == 'all'
Requires-Dist: kubernetes>=26.1.0; extra == 'all'
Requires-Dist: mkdocs-material>=9.1.6; extra == 'all'
Requires-Dist: mkdocs>=1.4.2; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.20.0; extra == 'all'
Requires-Dist: mypy>=1.2.0; extra == 'all'
Requires-Dist: pre-commit>=3.3.1; extra == 'all'
Requires-Dist: pytest-asyncio; extra == 'all'
Requires-Dist: pytest-cov>=4.1.0; extra == 'all'
Requires-Dist: pytest-mock>=3.10.0; extra == 'all'
Requires-Dist: pytest>=7.3.1; extra == 'all'
Requires-Dist: ruff>=0.0.260; extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.3.0; extra == 'dev'
Requires-Dist: httpx; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.2.0; extra == 'dev'
Requires-Dist: pre-commit>=3.3.1; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.10.0; extra == 'dev'
Requires-Dist: pytest>=7.3.1; extra == 'dev'
Requires-Dist: ruff>=0.0.260; extra == 'dev'
Provides-Extra: docker
Requires-Dist: docker>=6.0.0; extra == 'docker'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.1.6; extra == 'docs'
Requires-Dist: mkdocs>=1.4.2; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.20.0; extra == 'docs'
Provides-Extra: kubernetes
Requires-Dist: kubernetes>=26.1.0; extra == 'kubernetes'
Description-Content-Type: text/markdown

# llama-ctrl

[![PyPI version](https://img.shields.io/pypi/v/llama_ctrl.svg)](https://pypi.org/project/llama_ctrl/)
[![License](https://img.shields.io/github/license/llamasearchai/llama-ctrl)](https://github.com/llamasearchai/llama-ctrl/blob/main/LICENSE)
[![Python Version](https://img.shields.io/pypi/pyversions/llama_ctrl.svg)](https://pypi.org/project/llama_ctrl/)
[![CI Status](https://github.com/llamasearchai/llama-ctrl/actions/workflows/llamasearchai_ci.yml/badge.svg)](https://github.com/llamasearchai/llama-ctrl/actions/workflows/llamasearchai_ci.yml)

**Llama Control (llama-ctrl)** is a versatile command-line interface (CLI) and Python client library designed for interacting with and managing various LlamaSearch AI operations. It provides a unified entry point for controlling models, managing configurations, and executing tasks within the LlamaSearch ecosystem. The tool is optimized for different hardware, including Apple Silicon (M1/M2/M3), to ensure efficient performance.

## Key Features

- **Unified CLI Interface:** Control various LlamaSearch functions via a single `llama-ctrl` command.
- **Python Client Library:** Integrate control functionality directly into your Python applications.
- **Hardware Optimization:** Includes specific optimizations for Apple Silicon (M-series chips).
- **Request Handling:** Uses a factory pattern to dynamically select appropriate handlers (e.g., default, chat, REPL).
- **Caching:** Built-in file-based caching to speed up repeated operations (especially LLM calls).
- **Extensible:** Designed to be easily extended with new commands and handlers.

## Installation

```bash
pip install llama-ctrl
# Or install directly from GitHub for the latest version:
# pip install git+https://github.com/llamasearchai/llama-ctrl.git
```

## Usage

### Command-Line Interface (CLI)

The CLI provides various subcommands. Use `--help` to explore options:

```bash
llama-ctrl --help
llama-ctrl <command> --help
```

*(More specific CLI examples will be added as commands are finalized)*

### Python Client

```python
from llamasearch_ctrl import Client # Assuming Client class exists

# Initialize the client (configuration details might vary)
# client = Client(api_key="YOUR_API_KEY") # Example configuration
client = Client() # Basic initialization

# Example: Process some data or execute a command
# The exact methods will depend on the final API design
# result = client.execute_command("some_command", param="value")
# print(result)

# Example from original README (adjust class/method names if needed)
# from llamasearch_ctrl import LlamaCtrlClient
# client = LlamaCtrlClient(api_key="your-api-key")
# result = client.query("your query")
# print(result)
```
*(Note: The Python client API details need refinement based on the actual implementation in `src/llamasearch_ctrl`)*

## Architecture Overview

`llama-ctrl` follows a modular design:

```mermaid
graph TD
    A[CLI (Typer) / Python Client] --> B{Handler Factory};
    B -- Selects Handler --> C[Default Handler];
    B -- Selects Handler --> D[Chat Handler];
    B -- Selects Handler --> E[REPL Handler];
    B -- Selects Handler --> F[M3 Optimized Handler];
    B -- Selects Handler --> G[... other handlers];
    C --> H(Core Logic / LLM Interaction);
    D --> H;
    E --> H;
    F --> H;
    G --> H;
    H --> I[Cache System];
    A --> J[System Info (OS/CPU Detection)];
    J --> B;
    J --> F;

    style H fill:#f9f,stroke:#333,stroke-width:2px
    style I fill:#ccf,stroke:#333,stroke-width:1px
```

1.  **Entry Point:** User interacts via the CLI (`typer`) or Python client.
2.  **System Info:** Detects OS and CPU (e.g., Apple Silicon M3) for potential optimizations.
3.  **Handler Factory:** Selects the appropriate handler based on the command/context and system info.
4.  **Handlers:** Specific handlers (Default, Chat, REPL, M3-optimized, etc.) process the request.
5.  **Core Logic:** Handlers interact with the core LlamaSearch functionalities or LLMs.
6.  **Caching:** Results can be cached to improve performance for subsequent identical requests.

## Configuration

*(Details on configuration files, environment variables, or API keys needed by `llama-ctrl` will be added here.)*

## Development

### Setup

```bash
# Clone the repository
git clone https://github.com/llamasearchai/llama-ctrl.git
cd llama-ctrl

# Create and activate a virtual environment (recommended)
# python -m venv venv
# source venv/bin/activate # or .\venv\Scripts\activate on Windows

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

### Testing

```bash
pytest tests/
```

### Contributing

Contributions are welcome! Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines and submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
