Skip to main content

A no-API-key, CPU-friendly GenAI library for text generation, summarization, sentiment classification, and translation.

Project description

๐Ÿง  TextKit

A minimal, CPU-friendly, no-API-key-required LLM-powered Python library โ€” for text generation, summarization, sentiment classification, and translation.

โšก Just pip install textkit and you're ready to build with 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 TextKit

pip install 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 textkit

๐Ÿ Quick Start

from 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

genai_textkit-0.1.5.tar.gz (3.9 kB view details)

Uploaded Source

Built Distributions

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

genai_textkit-0.1.5.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

genai_textkit-0.1.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file genai_textkit-0.1.5.tar.gz.

File metadata

  • Download URL: genai_textkit-0.1.5.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

Hashes for genai_textkit-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b8c938416b89236ca52d95b12240f4270949389bfc806bd4c67bf4ade2a95f2f
MD5 1709a3e7df1bead7819840f223d6012b
BLAKE2b-256 16006273313b2a561bd85d1dd07c0bb620f48ccbd349dbe68336dcc4c81b711a

See more details on using hashes here.

File details

Details for the file genai_textkit-0.1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for genai_textkit-0.1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b59f5bcfa5b53199f24cc21c45977aa55b1e4a951df254a72782efb65cbef745
MD5 4e67cc4e8a3efa1c3a6f8f648ded0a09
BLAKE2b-256 45839d025e0a4f99ec5f1436e0fa20e42d7ce167132f2dd78b3912c719ade0a7

See more details on using hashes here.

File details

Details for the file genai_textkit-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: genai_textkit-0.1.5-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

Hashes for genai_textkit-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3a2864bdd9e5e8cbf8f3fa5106241f0a9eab91c1f87c4e40911ff30359061639
MD5 3e3cb781c41d4d94cac054354c5f3444
BLAKE2b-256 8bc35e44de148b69c889133aa9831bbc3d54f6bce706a65a2843224c8f4950aa

See more details on using hashes here.

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