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

Uploaded Source

File details

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

File metadata

  • Download URL: potatoplm-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 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.1.tar.gz
Algorithm Hash digest
SHA256 0d5c99bdac4d198b86ab82e58d88aacc3411a772b15f3d6d2032c35cbe6e478b
MD5 e470d49d40ec14b56f53876a6fc7a0c7
BLAKE2b-256 6960d423da4bb7a9f9409724259209f3906f86c77a93509b4d8c5d187bde77d1

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