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 prompts. Instead, the contents of the first few registers are presented to the LLM. Through 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 computing engine that potentially can improve itself by rewriting some of its own prompts or codes in registers.

Following instruction set is provided for 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

Main clock cycle:

llmpu.cycle()
# this will provide all visible registers to llm, and execute the code generated by llm

Minimum Example

# using default config
firmware = """
You are a processing unit with many registers (this is register 0, or r0) with string values. Each register can store up to 5000 characters. Registers 0-15 (r0 to r15) are visible to you, and other registers are available but not presented to you. You can operate on registers using the following functions:
- `READ(r)` returns content in register number `r`
- `WRITE(r, content)` store string `content` in register number `r`. The content will be truncated to 5000 characters maximum.
- `CALL(r)` execute the content in register number `r` as Python code.

Conventional register purpose:
- 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.3.tar.gz (4.1 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.3-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmpu-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 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.3.tar.gz
Algorithm Hash digest
SHA256 cb23d014f352132d616e2b4897cd837c9468fd6e683016d6beb4cb561e8846bd
MD5 d68d5ff3da490db235dafaae699b0dfb
BLAKE2b-256 cfb0203e44f4cae60057d9a5e8d681e93b74befd4a01a08d471901b4313fcf38

See more details on using hashes here.

Provenance

The following attestation bundles were made for llmpu-0.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: llmpu-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b11b6abff882e362818b3ce181d17ce5a04f33f9a56d50375475e0b04935f3e7
MD5 ee1f129f3ea64b0e717660a42aaf5073
BLAKE2b-256 09d7b223398610b631718538acc6306d28b7d005b69af1935da22017cd1a652e

See more details on using hashes here.

Provenance

The following attestation bundles were made for llmpu-0.0.3-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