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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98764a1e8c6c44cad6c8e591d3d7dd8b1bb26d93f2357210b0765663869ae358
|
|
| MD5 |
d5d023831ce38db86127c40adf055196
|
|
| BLAKE2b-256 |
ef64496c8fad251566a0f3ac7d8ac0f684ca788cc08ca186bd03326c1cb3a48d
|
Provenance
The following attestation bundles were made for cognix_ai-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on golemgamer/cognix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognix_ai-0.1.0.tar.gz -
Subject digest:
98764a1e8c6c44cad6c8e591d3d7dd8b1bb26d93f2357210b0765663869ae358 - Sigstore transparency entry: 1290927193
- Sigstore integration time:
-
Permalink:
golemgamer/cognix@b69ea8a8184c62c77db2b66f17a888225fc723de -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/golemgamer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b69ea8a8184c62c77db2b66f17a888225fc723de -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
742b6199d9e86fa703814e57b5e2727df0eb889bb42d189b5239a99f23d2e541
|
|
| MD5 |
725440f2b1e38854b81ec304ef9b4a98
|
|
| BLAKE2b-256 |
50c27fc2b1f029aed01b9924e3f893a8c30efb94ffc46873e770e64de3d72dbd
|
Provenance
The following attestation bundles were made for cognix_ai-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on golemgamer/cognix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognix_ai-0.1.0-py3-none-any.whl -
Subject digest:
742b6199d9e86fa703814e57b5e2727df0eb889bb42d189b5239a99f23d2e541 - Sigstore transparency entry: 1290927306
- Sigstore integration time:
-
Permalink:
golemgamer/cognix@b69ea8a8184c62c77db2b66f17a888225fc723de -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/golemgamer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b69ea8a8184c62c77db2b66f17a888225fc723de -
Trigger Event:
release
-
Statement type: