Metadata-Version: 2.3
Name: capibara-model
Version: 1.2.2
Summary: A State Space and Mamba-based language model framework
Project-URL: Homepage, https://github.com/anachroni-io/CapibaraModel-cli
Project-URL: Documentation, https://capibaramodel.readthedocs.io/
Project-URL: Repository, https://github.com/anachroni-io/CapibaraModel-cli.git
Project-URL: Issues, https://github.com/anachroni-io/CapibaraModel-cli/issues
Author-email: Marco Durán <marco@anachroni.co>
License: 
        # Capibara Licence v1.1
        
        ## Preamble
        
        The **Capibara Licence** is a license based on the principles of the GNU General Public License v3 and the MIT License 3.0, with the addition of ethical restrictions and obligations that enure transparent and responsible use of the software. This license aims to preserve the freedom of the software and ensure its use is ethical and in line with respect for human rights and technological optimization.
        
        ## Permissions and Conditions
        
        ### The following rights are granted
        
        1. **Free Use**: Any person is granted the right to use, copy, modify, and distribute the software.
        2. **Distribution**: Users can distribute copies of the original or modified software, as long as this license remains attached in its entirety and none of its clauses are omitted.
        3. **Creation of Derivatives**: The creation of derivative software is allowed, as long as the original or modified source code is distributed under this same license.
        4. **Commercial Use**: The software may be used for commercial purposes, as long as this license is included and any misuse by third parties is reported.
        5. **Transparency in AI**: If the software or its derivatives are used in artificial intelligence applications, the user must provide transparency regarding the use of data, the results obtained, and any models employed.
        
        ### Obligations
        
        1. **Contribution to the Community**: Any improvements, patches, or modifications must be shared with the community within a reasonable timeframe, fostering the evolution of the software in the open-source ecosystem.
        2. **Ethical and Bias Commitment**: Any AI system using this software must align with ethical principles and undergo bias reviews to avoid discrimination or unfair practices.
        3. **Technological Optimization**: Code modifications must prioritize efficiency and technological sustainability, promoting optimal use of computational resources.
        
        ## Restrictions
        
        ### Ethical Use
        
        1. **Prohibition of Illegal or Harmful Uses**: This software cannot be used for purposes that violate human rights or promote illegal or harmful activities. This includes, but is not limited to, mass surveillance, autonomous weapons, algorithmic discrimination, and unethical manipulation of data.
        2. **Protection of Rights**: The software cannot be used in applications that violate personal privacy or safety.
        
        ## Penalties
        
        ### Legal Enforcement
        
        1. **Misuse**: Any misuse of this software, omission of this license, or its use in proprietary software without respecting the terms set forth herein, will be pursued through all available legal means.
        2. **Prohibition of Proprietary Software**: This software cannot be integrated into proprietary software under any circumstances. Any software that uses this code, either partially or entirely, must be distributed under the terms of the **Capibara Licence**.
        3. **Mandatory Reporting**: If third-party misuse of the software is identified, the user is obligated to report such misuse to the original project maintainers and the appropriate authorities.
        
        ## Legal Execution
        
        To ensure the compliance of this license, a voluntary contribution to the project is requested. This contribution will be directed to the **Anachroni Foundation**, which will oversee the proper enforcement of the ethical and legal commitments associated with this software, as well as the pursuit of any misuse or omission of the license in proprietary software.
        
        ## Disclaimer of Liability
        
        This software is provided "as is," without warranties of any kind, either express or implied, including but not limited to warranties of merchantability or fitness for a particular purpose. The authors and contributors are not liable for any damages, claims, or harm caused by the use of this software.
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: flax
Requires-Dist: jax>=0.4.13
Requires-Dist: numpy>=1.20
Requires-Dist: optax
Requires-Dist: tensorflow>=2.13
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.30.0
Requires-Dist: wandb
Description-Content-Type: text/markdown

# CapibaraModel CLI

![Capibara SSBD Model](./capibara_model/src/public/3BSSBD.webp)

CapibaraModel is a command-line tool for training, evaluating, and deploying language models based on State Space and Mamba architectures, optimized for TPUs and featuring advanced hyperparameter optimization.

## 🚀 Key Features

- **Advanced Architectures**:
  - BitNet + Liquid Architecture
  - Aleph-TILDE Module Integration
  - Mamba SSM Architecture
  - Capibara JAX SSM Implementation
  
- **Core Capabilities**:
  - Model training and evaluation
  - Native TPU/GPU support
  - Automatic hyperparameter optimization
  - Integrated deployment system
  - Performance measurement
  - Docker containers (optional)
  - Weights & Biases integration

## 📋 Requirements

- Python 3.9+
- JAX 0.4.13+
- CUDA 11.8+ (for GPU)
- TensorFlow 2.13+
- Weights & Biases
- Docker (optional)

## 🛠️ Installation

1. Clone this repository:

   ```bash
   git clone https://github.com/anachroni-io/CapibaraModel-cli.git
   cd CapibaraModel-cli
   ```

2. Install dependencies:

   ```bash
   pip install -r requirements.txt
   ```

3. Set up Weights & Biases:

   ```bash
   wandb login
   ```

## 📖 Documentation

Full documentation available at [Read the Docs](https://capibaramodel.readthedocs.io/):

- Quick start guide
- Complete tutorial
- API reference
- Usage examples
- Contribution guide

## 💻 Usage

```bash
capibara [options]

# Basic training
capibara --train

# Evaluation with specific layer
capibara --evaluate --new-layer BitNetLiquid

# Optimization with sub-model
capibara --optimize --sub-model AlephTilde
```

### Available Options

- `--log-level`: Logging level (DEBUG, INFO, WARNING, ERROR)
- `--train`: Train model
- `--evaluate`: Evaluate model
- `--optimize`: Hyperparameter optimization
- `--deploy`: Deploy model
- `--measure-performance`: Measure performance
- `--model`: Path to model YAML file
- `--new-layer`: Activate new layers
- `--sub-model`: Specify sub-models

## ⚙️ Configuration

```yaml
model:
  name: "capibara-ent"
  version: "2.0"
  layers:
    - type: "BitNetLiquid"
      config:
        hidden_size: 768
        num_heads: 12
    - type: "AlephTilde"
      config:
        rule_format: "prolog"
        min_confidence: 0.8
```

## 🧪 Testing

```bash
# Unit tests
pytest tests/

# Integration tests
pytest tests/integration/

# Verify documentation
sphinx-build -b doctest docs/source/ docs/build/
```

## 📝 Citation

```bibtex
@software{capibara2024,
  author = {Durán, Marco},
  title = {CapibaraModel: A Large Language Model Framework},
  year = {2024},
  publisher = {GitHub},
  url = {https://github.com/anachroni-io/CapibaraModel-cli}
}
```

## 📄 License

Distributed under the MIT License. See `LICENSE` for more information.

## 📫 Contact

Marco Durán - marco@anachroni.co

[Website](https://www.anachroni.co) | [GitHub](https://github.com/anachroni-io/CapibaraModel-cli)
