Skip to main content

A pure Python LLM library implemented with NumPy (Llama-style architecture).

Project description

PotatoPLM

PotatoPLM is a Pure Python LLM library implemented from scratch using NumPy. It aims to be a transparent and educational implementation of the Transformer architecture.

Features

  • Pure NumPy-based Transformer implementation.
  • Llama-style architecture:
    • RMSNorm for normalization.
    • RoPE (Rotary Positional Embeddings).
    • SwiGLU activation function.
  • Minimal dependencies (only numpy).
  • Python 3.10 compatible.
  • GPT-style Decoder-only architecture.

Installation & Setup

We recommend using a virtual environment:

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install the package in editable mode
pip install -e .

Usage Example

Run the toy inference example:

python3 examples/toy_inference.py

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

potatoplm-0.2.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

potatoplm-0.2.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file potatoplm-0.2.3.tar.gz.

File metadata

  • Download URL: potatoplm-0.2.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for potatoplm-0.2.3.tar.gz
Algorithm Hash digest
SHA256 d587f60866742ff29f59316268a19873f73e06d86ec54c2171c9f50cf87a85cf
MD5 37b89337dbc1b30ac7f28c4679ef5027
BLAKE2b-256 ed3505e81c822dfd948b442b52e25cdebb5d6d94f3eae85618b60cea16f26f0d

See more details on using hashes here.

File details

Details for the file potatoplm-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: potatoplm-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for potatoplm-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 03189c29a59e58b27ab267c7b57a628226fbeffe3acbebe1e5e2316835a87da0
MD5 0f3f23f1de8e3da3cffb8bec92b6678a
BLAKE2b-256 1f9a4f9768a87f21b3634549f5ccd1d5cb6629deb1515eab909ade3a0cf5f250

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