Skip to main content

Large Language Blocks - A context packaging format for LLMs

Project description

LLB (Large Language Blocks)

A context packaging format designed for LLMs.

Installation

pip install llb_doc

Quick Start

from llb_doc import create_llb, parse_llb

doc = create_llb()

# Method 1: Fluent API
doc.block("ticket", lang="en").meta(source="jira", priority="high").content(
    "User cannot upload files larger than 10MB"
).add()

# Method 2: Context manager
with doc.block("api", "json") as b:
    b.source = "storage_service"
    b.content = '{"max_size": 5242880, "unit": "bytes"}'

# Method 3: Direct add
doc.add_block("note", "前端限制与后端配置不一致", source="code_review", lang="zh")

# Render to LLB format
print(doc.render())

# Parse LLB text back to document
doc2 = parse_llb(doc.render())

Output

@block b1 ticket en
source=jira
priority=high

User cannot upload files larger than 10MB

@end b1

@block b2 api json
source=storage_service

{"max_size": 5242880, "unit": "bytes"}

@end b2

@block b3 note zh
source=code_review

前端限制与后端配置不一致

@end b3

Block Structure

Each block follows this structure:

@block <id> <type> [lang]
key1=value1
key2=value2

<content>

@end <id>

Roadmap

  • Flat Mode (independent blocks)
  • Graph Mode (@ctx, @node, @edge for graph-structured context)

License

MIT

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

llb_doc-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

llb_doc-0.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file llb_doc-0.1.1.tar.gz.

File metadata

  • Download URL: llb_doc-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llb_doc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a999d00003ecaf0a3dd35980003640148aa70ccc388ed84c638daa0c41ba51c0
MD5 a0f1ce5ff6f5b37d285ad0e1d1bf4f69
BLAKE2b-256 f3ddeb7e03608df6d9f557c3d1548ce1d75b2b0f686135d6e5cbc7f0f9a9e435

See more details on using hashes here.

File details

Details for the file llb_doc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: llb_doc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llb_doc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0300fb5baad7b70539d2746cfc52da6a694a613aa3144c0d3e00b1ad784f8c91
MD5 77a0bf2d19cff86e9a4412161ba99d8f
BLAKE2b-256 7312657c5addb2824ff4cfaf44f53b18bd1dc1d0bdb51ac13d2884d809f79417

See more details on using hashes here.

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