Skip to main content

Large Language Model Process Unit

Project description

LLMPU

Large Language Model Process Unit

Imagine a process 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 process unit will be able to read, write, and execute code from any register. Then the process 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 process 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 process 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.2.tar.gz (4.0 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.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmpu-0.0.2.tar.gz
  • Upload date:
  • Size: 4.0 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.2.tar.gz
Algorithm Hash digest
SHA256 150f11a5c5fab583908c57a92d30eec747580a7d0851dbd48071791ed5f9cb44
MD5 d1d353e4c40a7a885d046c2f19dd2d2d
BLAKE2b-256 3b68106603a425eab2820f5b4e230072bad3f69af0d0e7b5aa6136547390a019

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: llmpu-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 333bd10f100196e01d142f4ff2b327363389b78a5afe04248d2ecdb0ae89ab71
MD5 a48ab77036861c1f5c0bf07d71d5b445
BLAKE2b-256 62a4a617a952040989f3eb338a8b9e3dda4e58ec3345862bd4fe0f0588fc6db0

See more details on using hashes here.

Provenance

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