Skip to main content

Large Language Model Processing Unit

Project description

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, write, and execute code from any register. 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 number r
  • write(r, content) store string content in register number r
  • call(r) execute the content in register number r as 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({
    # "VR": 16, # visibile register number
    # "L": 10000, # hard character number limit for register
    # "model": "gemini-3.5-flash", # llm model
    "api_key": "your llm api key", # llm api key
    # "llm_config": {}, # llm config
    # "log_path": "llmpu.log", # log path
})

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.call(100) # execute code in register 100

Control functions:

# main clock cycle
# present visible registers to LLM, then execute the generated code.
llmpu.cycle()

# core dump
llmpu.dump("dump.json") # dump state to a json file
llmpu.load("dump.json") # load state from a json file

Minimum Example

# using default config
firmware = """You are a self-improving processing unit with registers: max 5000 chars each, r0-r15 visible, more available but hidden.

API:
- read(r: int) -> str: read register r.
- write(r: int, content: str): write content in r (truncated to 5000 chars).
- call(r: int): Run register r's content as Python code.

common registers:
- r1: current task
"""
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.cycle() # r10001 will be loaded to r1
llmpu.cycle() # print "hello", then call r10010, which will print "hello again" and write r10000 to r1
llmpu.cycle() # pass

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

llmpu-0.0.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

llmpu-0.0.5-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file llmpu-0.0.5.tar.gz.

File metadata

  • Download URL: llmpu-0.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llmpu-0.0.5.tar.gz
Algorithm Hash digest
SHA256 930fb6fa77d9f35407432218ed793ca74b631ee7c488e9740ede76388036995c
MD5 cb5e3722dab7c748008430892b733a64
BLAKE2b-256 2c2df6ad62826561f8688cfe59b7ae004b1e50d13d807bfa73f08e312d47436a

See more details on using hashes here.

Provenance

The following attestation bundles were made for llmpu-0.0.5.tar.gz:

Publisher: manual-publish-pypi.yml on yzITI/llmpu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llmpu-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: llmpu-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llmpu-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 92fc3d9cef2374b7646e976b23ec51d084536ab4683934c350c81bf1d880f1ff
MD5 49680ba032e57bd6b3a94ea4f727fd34
BLAKE2b-256 b4342ed261ee075512b07d82f57328d2eea94c2510fe772ae28f329aebab5ec9

See more details on using hashes here.

Provenance

The following attestation bundles were made for llmpu-0.0.5-py3-none-any.whl:

Publisher: manual-publish-pypi.yml on yzITI/llmpu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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