Skip to main content

Large Language Model Process Unit

Project description

LLMPU

Large Language Model Process Unit

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
})

Helper functions:

llmpu.write(100, "print('hello')") # truncate if exceed config["L"]
llmpu.read(100) # "print('hello')"
llmpu.call(100) # execute code in register 100

Main 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.1.tar.gz (3.7 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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmpu-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 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.1.tar.gz
Algorithm Hash digest
SHA256 cd92b337d5cfcdb8beb027c0c14bc29fd9699e0ebfb451b5390e4550cbf34311
MD5 2daf84881cb66eadb8d0e1fd7c25b071
BLAKE2b-256 886b06aaf9312d65a8a85559037969f14539337290e0dfba2479120244eb3804

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: llmpu-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dffce40898f05d32f33dd7b34e2eb3a57fab29d4efb11f1046c4a60f02119601
MD5 fa8f13ecf403879c34522da6b4138dc2
BLAKE2b-256 f059c60f1a864388ab646cc073b10b152feb4adcba43f4d86b68a71f095335ce

See more details on using hashes here.

Provenance

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