Metadata-Version: 2.4
Name: cognix-ai
Version: 0.1.0
Summary: A simplified AI library for model management, inference, and fine-tuning.
Author: BUEORM
Author-email: Gerson Buenahora <dalusx64@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/golemgamer/cognix
Project-URL: Bug Tracker, https://github.com/golemgamer/cognix/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: transformers
Requires-Dist: datasets
Requires-Dist: peft
Requires-Dist: accelerate
Requires-Dist: bitsandbytes
Requires-Dist: torch
Requires-Dist: torchvision
Requires-Dist: huggingface_hub
Requires-Dist: pillow
Requires-Dist: requests
Dynamic: author
Dynamic: license-file
Dynamic: requires-python

# Cognix AI Library

Cognix is a simplified Python library for model management, inference, and fine-tuning. It provides a high-level API to interact with Hugging Face models effortlessly.

## Installation

```bash
pip install -e .
```

## Features

- **Simplified Model Loading**: Load models for Chat, Vision, or Classification with one line.
- **Easy Fine-Tuning**: Built-in support for LoRA/QLoRA for efficient training.
- **Hugging Face Integration**: Simple login and model downloading.
- **Unified Interface**: `generate()` for LLMs, `predict()` for Vision/Classification.

## Quick Start

### 1. Login to Hugging Face
```python
import cognix
cognix.login("your_hf_token")
```

### 2. Load and Use an LLM (Chat)
```python
import cognix

# Load a model for chat (supports 4bit/8bit quantization)
model = cognix.load_model("gpt2", task="chat")

# Generate text
response = model.generate("The future of AI is")
print(response)
```

### 3. Image Classification / Vision
```python
import cognix

# Load a vision model
vision_model = cognix.load_model("google/vit-base-patch16-224", task="vision")

# Predict from URL or local path
result = vision_model.predict("https://example.com/image.jpg")
print(result)
```

### 4. Fine-Tuning with LoRA
```python
import cognix

# Load model and dataset
model = cognix.load_model("gpt2", task="chat", quantization="4bit")
dataset = cognix.load_dataset("my_data.json")

# Initialize trainer
trainer = cognix.Trainer(model, dataset, output_dir="./my_fine_tuned_model")

# Train!
trainer.train(epochs=1, lr=5e-5, batch_size=4)

# Save the adapter
trainer.save()
```

## License
MIT
