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.0.tar.gz (1.9 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: potatoplm-0.2.0.tar.gz
  • Upload date:
  • Size: 1.9 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.0.tar.gz
Algorithm Hash digest
SHA256 3ed13bea2196f31c2694c043e6ad863f8f1d9b3a789e5947b42fe880bf78649b
MD5 56e3c9918e9f20ab36a068e2aea89b06
BLAKE2b-256 ac0a676f3427cae3fed57dd0de66ccd636423a7e9a1b0a2e9bb016e2e0f6f250

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