Skip to main content

LightGPT – Simple Hugging Face Wrapper

🎉 LightGPT 1.0.0 – Celebration 🎉

We’re thrilled to announce the first stable release of LightGPT! This version marks the end of the beta phase and brings a polished, production‑ready package that:

  • Uses the lightweight EleutherAI/gpt‑neo‑125M model by default.
  • Provides holiday personas for fun themed interactions.
  • Includes a quick Wikipedia data collector for easy finetuning.
  • Offers a simple CLI, finetuning script, and ONNX export workflow.

Quickstart

# Install dependencies (including Wikipedia support)
pip install -r requirements.txt
from lightgpt.model import LightGPT

lgpt = LightGPT()  # loads EleutherAI/gpt-neo-125M
print(lgpt.generate("The future of AI is", max_new_tokens=30))

Command‑line interface

python -m lightgpt.cli \
    --model EleutherAI/gpt-neo-125M \
    --prompt "Once upon a time" \
    --max_new_tokens 40 \
    --temperature 0.9 \
    --do_sample

Finetuning a model

A minimal finetuning script is provided in src/lightgpt/train.py. It uses the standard transformers training loop.

python -m lightgpt.train \
    --model EleutherAI/gpt-neo-125M \
    --train_file data/my_corpus.txt \
    --output_dir finetuned_gptneo \
    --epochs 3

The script writes a new directory containing a pytorch_model.bin and tokenizer files that can be loaded with LightGPT(model_name="finetuned_gptneo").

Export to ONNX (for Hugging Face Hub)

python -m lightgpt.export_onnx \
    --model finetuned_gptneo \
    --output lightgpt_neo.onnx

The resulting lightgpt_neo.onnx can be uploaded to the Hugging Face Model Hub alongside the saved model folder.

Wikipedia data collection

Use the provided script to fetch articles for training:

python scripts/download_wiki.py \
    --topics "Artificial intelligence" "Machine learning" "Natural language processing" \
    --output wiki_corpus.txt

Holiday Personas

from lightgpt.holiday_personas import get_persona_prompt

prompt = get_persona_prompt("may_the_4th") + " What is the Force?"
print(LightGPT().generate(prompt))

License

MIT – see LICENSE for details.

Metadata

Release files for lightgpt 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lightgpt 1.0.0
File Size Uploaded
lightgpt-1.0.0.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lightgpt 1.0.0
File Interpreter ABI Platform
lightgpt-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.0 kB

Release files / lightgpt-1.0.0.tar.gz

Download URL lightgpt-1.0.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ba7912f4578186ab81ad828bb1e83c6bffdf3a81141555cafb4e8036eb7326e1
BLAKE2b-256 checksum
How to use checksums
ffb86efd3f0defa2ff9a71085358c42146aece04c3747abf87ed68524d31e024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / lightgpt-1.0.0-py3-none-any.whl

Download URL lightgpt-1.0.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
153e7ccd9310d01c9d0e87045cca136d30be0485c824797b47fe0065c17e3f6d
BLAKE2b-256 checksum
How to use checksums
10c904afaacf546d058994c28fef88a89feb253e15d45e82760a5c63a8062855
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page