Skip to main content

A simplified AI library for model management, inference, and fine-tuning.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

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

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

import cognix
cognix.login("your_hf_token")

2. Load and Use an LLM (Chat)

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

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

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

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

cognix_ai-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

cognix_ai-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file cognix_ai-0.1.0.tar.gz.

File metadata

  • Download URL: cognix_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cognix_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98764a1e8c6c44cad6c8e591d3d7dd8b1bb26d93f2357210b0765663869ae358
MD5 d5d023831ce38db86127c40adf055196
BLAKE2b-256 ef64496c8fad251566a0f3ac7d8ac0f684ca788cc08ca186bd03326c1cb3a48d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognix_ai-0.1.0.tar.gz:

Publisher: pypi-publish.yml on golemgamer/cognix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cognix_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cognix_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cognix_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 742b6199d9e86fa703814e57b5e2727df0eb889bb42d189b5239a99f23d2e541
MD5 725440f2b1e38854b81ec304ef9b4a98
BLAKE2b-256 50c27fc2b1f029aed01b9924e3f893a8c30efb94ffc46873e770e64de3d72dbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognix_ai-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on golemgamer/cognix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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