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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file potatoplm-0.2.2.tar.gz.
File metadata
- Download URL: potatoplm-0.2.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a22ac3646c0c8aad726cf36cb7d388d782a9360bef8fd2a069c7e7cee69e0238
|
|
| MD5 |
be1bb1c232fbba63c87f907bdf8ec98f
|
|
| BLAKE2b-256 |
9ea82a3330d04f824fc31ad12d97c29b6de6f90e325ff5067bfbd0f64f31fcf5
|
File details
Details for the file potatoplm-0.2.2-py3-none-any.whl.
File metadata
- Download URL: potatoplm-0.2.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbbc52e537a44fa1943753674c48f091846c719064bfee121abf443d1ac620c8
|
|
| MD5 |
9d227fc10d82c408ee44935d18951fe1
|
|
| BLAKE2b-256 |
6482532bf4993b905c0749880fdac503aa331bfe730209109177ae3db3aec8b8
|