Skip to main content

A toolkit for building an LLM from scratch

Project description

llm-from-scratch-lab

Lab and python package for building a small GPT model. This code was adapted from the Build a Large Language Model (From Scratch) repository. This lab is intended to be a learning exercise, not a production-ready implementation. It is still very much a work in progress, and in some regards, a little incomplete. However, it is a good starting point for understanding how to build a small GPT model from scratch.

Usage

There is a run_lab.py script that can be used to run the lab. It will send a piece of text to the lab and the lab will perform the preprocessing, tokenization, and model inference steps. The output will be printed to the console.

Package Usage

Install the package using pip:

pip install llm-from-scratch-lab

Then, you can use the package in your Python scripts:

from llm_scratch_lab.lab import GPTLab

gpt_lab = GPTLab()
print("Running GPT Lab...")

gpt_lab.run("Hello, I am", with_manual_seed=True)

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

llm_scratch_lab-0.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

llm_scratch_lab-0.0.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_scratch_lab-0.0.2.tar.gz.

File metadata

  • Download URL: llm_scratch_lab-0.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for llm_scratch_lab-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ae5bfac167c35d2d6240927ecbd38f64fa7f2fefe2072bcbde716b6cd2b5290b
MD5 bbc8edcee6fb6b6adfd70f46720561ab
BLAKE2b-256 a4d21c1aced718b83c21555d296a1f29377b11cac9e8f1a2c98bd3e08a5d848e

See more details on using hashes here.

File details

Details for the file llm_scratch_lab-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_scratch_lab-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 54b9e6f0d73bb99cebc305a5c1f6acdfc33c85bb6578e3aa1328b5a0df688368
MD5 778851dbac4979251fc439b7b7a52e0c
BLAKE2b-256 dd4eae0a7e154ef6f8aff4dba146425b08c4f7ab21ad7f7aee0328fa60ee5523

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