A no-API-key, CPU-friendly GenAI library for text generation, summarization, sentiment classification, and translation.
Project description
๐ง GenAI-TextKit
A minimal, CPU-friendly, no-API-key-required LLM-powered Python library โ for text generation, summarization, sentiment classification, and translation.
โก Just
pip install genai_textkitand you're ready to build with GenAI-TextKit on any machine.
๐ Features
- โ
Offline text generation with
distilgpt2 - โ
Fast summarization with
distilbart-cnn-12-6 - โ
Sentiment classification using
distilbert-sst2 - โ
Multilingual translation via
facebook/nllb-200-distilled-600M - โ Works on CPU โ no GPU required
- โ No API keys, no internet after install
๐ฆ Installation
Step 1: Install GenAI-TextKit
pip install genai_textkit
Step 2: (If not already installed) Install PyTorch manually
pip install torch --index-url https://download.pytorch.org/whl/cpu
Author: Abhinav | GitHub: [IamAbhinav01](https://github.com/IamAbhinav01)
Repository: [IamAbhinav01/GenAI](https://github.com/IamAbhinav01/GenAI)
---
## ๐ Features
- โ
Offline text generation with `distilgpt2`
- โ
Fast summarization with `distilbart-cnn-12-6`
- โ
Sentiment classification using `distilbert-sst2`
- โ
Multilingual translation via `facebook/nllb-200-distilled-600M`
- โ
Works on **CPU** โ no GPU required
- โ
No API keys, no internet after install
---
## ๐ฆ Installation
```bash
pip install genai_textkit
๐ Quick Start
from genai_textkit import generate, summarize, classify, translate
# Text generation
print(generate("Write a poem about the moon", max_tokens=50))
# Summarization
print(summarize("Your long text here..."))
# Sentiment Classification
print(classify("I really loved the product!"))
# Translation (English to Hindi)
print(translate("I am happy to meet you", to_lang="hi"))
๐ Supported Translation Languages
| Code | Language |
|---|---|
| en | English |
| hi | Hindi |
| ta | Tamil |
| ml | Malayalam |
| fr | French |
| es | Spanish |
| bn | Bengali |
๐ Project Structure
genai-toolkit/
โ
โโโ genai/ # Core package
โ โโโ __init__.py # Public API
โ โโโ text.py # generate, summarize, classify, translate
โ โโโ config.py # Device/model paths
โ โโโ download_models.py# Download models utility
โ
โโโ examples/ # Usage examples
โ โโโ example_generate.py
โ โโโ example_summarize.py
โ โโโ example_translate.py
โ โโโ example_classify.py
โ
โโโ tests/ # Unit tests
โ โโโ test_text.py
โ
โโโ requirements.txt # Python dependencies
โโโ pyproject.toml # Project metadata
โโโ README.md # Project documentation
โโโ ... # Other files
๐งช Run Examples
See the examples/ folder for ready-to-run scripts.
๐ค Contributing
Pull requests and issues are welcome! Please open an issue or PR on GitHub.
๐ License
MIT License ยฉ Abhinav
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
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 genai_textkit-0.1.7.tar.gz.
File metadata
- Download URL: genai_textkit-0.1.7.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bcfd18bfb19424b6bc9a3b0d55aad68d49c105dd23e494f65d70251f7316ad1
|
|
| MD5 |
c15b76978a33da814e27c711ecab5476
|
|
| BLAKE2b-256 |
05d0c8fe8e3021468bfbd31b8731063c2192030d2c325ca3ecdd7440a1e8caa9
|
File details
Details for the file genai_textkit-0.1.7-py3-none-any.whl.
File metadata
- Download URL: genai_textkit-0.1.7-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b077612b6dcad3f0f6a846c81c2b51f3a49617862743dbb58a743b220482010
|
|
| MD5 |
359f363f10a8eacf6c94c52002716446
|
|
| BLAKE2b-256 |
5368c4fbfc74f8d79ec046c78a029414e1097777f02d6f935f927d6b68d7a8fb
|