LLMPU
Large Language Model Processing Unit
Imagine a processing unit powered by LLM and infinite registers. Each register can store a string for prompts or codes. There is no fixed prompt. Instead, the contents of the first several registers are presented to the LLM. By generating code, the processing unit will be able to read and write any register, and directly execute the content of any register as Python code. Then the processing unit can be used as a general intelligent computing engine that potentially can improve itself by rewriting some of its own prompts or codes in registers.
The following instruction set is provided to the processing unit as Python functions:
read(r)returns content in register numberrwrite(r, content)store stringcontentin register numberrrun(r)execute the content in register numberras Python code
And their description is not hard coded, but stored in register 0, for example, as a "firmware".
Get Started
pip install llmpu
import llmpu
llmpu.init({ # default config here
"api_key": "", # llm api key
"VR": 16, # visibile register number
"L": 10000, # hard character number limit for register
"model": "gemini-flash-latest", # llm model
"llm_config": {}, # llm config
"EXEC": { # provided to execution environment, can be used by llm
"read": llmpu.read, "write": llmpu.write, "run": llmpu._run
}
})
Instruction set functions:
# use register 100 as an example
llmpu.write(100, "print('hello')") # truncate if exceed config["L"]
llmpu.read(100) # "print('hello')"
llmpu.run(100) # execute code in register 100
# llmpu.run also supports code string
Note:
llmpu._runshares the caller's locals, whilellmpu.runis isolated.
Control functions:
# main cycle: generate instructions
code = llmpu.cycle()
llmpu.run(code) # run the code
# core dump
llmpu.dump("dump.json") # dump state to a json file
llmpu.load("dump.json") # load state from a json file
Server and UI:
Network server uses srpc protocol. It only allows localhost traffic for security reason. Exposing the interface allows arbitrary code execution!
llmpu.serve(port=22222, browser=True)
Minimum Example
# using default config
firmware = """You are a self-improving processing unit with registers: r0-r15 visible, more available but hidden. Perform operations by generating Python code.
API:
- read(r: int) -> str: read register r.
- write(r: int, content: str): write content in r (truncated to 5000 chars).
- run(r: int): Run register r's content as Python code.
"""
llmpu.write(0, firmware)
llmpu.write(1, "load r10001 to r1")
llmpu.write(10000, "do nothing")
llmpu.write(10001, "print hello to the screen, then call r10010")
llmpu.write(10010, "print('hello again')\nwrite(1, read(10000))")
llmpu.run(llmpu.cycle()) # r10001 will be loaded to r1
llmpu.run(llmpu.cycle()) # print "hello", then call r10010, which will print "hello again" and write r10000 to r1
llmpu.run(llmpu.cycle()) # pass
Metadata
Release files for llmpu 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llmpu-0.2.6.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llmpu-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / llmpu-0.2.6.tar.gz
| Download URL | llmpu-0.2.6.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ee3a075f6a22567d7a6822642ec3d83e6bd686ad8a739a5312b6ea92fb71b18
|
|
BLAKE2b-256 checksum How to use checksums |
03868bc6d459cd6b47f7846ea7ab4c8423af7871b32386281febec5ccb9de35f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / llmpu-0.2.6-py3-none-any.whl
| Download URL | llmpu-0.2.6-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7b6574f0b09eec3749aaee2b63aa7d478a1bf52f3a093ce131996179c9b29ca
|
|
BLAKE2b-256 checksum How to use checksums |
7fbf74b3653865891898292a43ef158ee1eab7efa7bf1997271765e8bc03b771
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency log