Skip to main content

LLMON

LLMON (LLM Object Notation) is an LLM-native markup language for communicating concepts and structures with LLMs. This communication can occur as LLM inputs (training and prompts) as well as LLM outputs (responses). The goal is to encode richer meta information about the underlying text to make it easier for a model to learn and produce concepts as well as improve safety and security.

How to Use LLMON

Since LLMON is a markup language for text that is sent to and received from an LLM, it is natural to use it where this communication with the LLM occurs. Thus, depending on the users, they may or may not be exposed to LLMON. For example, if a user is interacting with an LLM using a python program developed using the Mellea library, the Mellea runtime will leverage LLMON without the end user being aware of its use, much like a python programmer isn't aware of the assembly instructions that are executed on its behalf. Similarly, if a user is using an agentic system or some other high-level interface to an LLM, they will not interact directly with LLMON.

However, there are other uses where it is desirable to have a model learn domain-specific concepts that can be expressed with LLMON. In these cases, the user can choose to fine-tune an existing LLMON model to understand these new concepts and then interact with the resulting model by passing in LLMON text that is annotated with these concepts.

We provide examples of this scenario in our llmon/examples/ directory.

A Little Taste of LLMON

Here's a simple example of LLMON:

    <|open|>instruction<|close|>
      Suggest a title for the following email:
    <|open_end|>
    <|open|>data<|close|>
      Dear customer support, I am writing about the wifi connection on my recent
      flight from JFK to LAX. The quality was poor. I paid $25, and I want a refund.
    <|open_end|>

This example communicates to the model that the Suggest ... line should be treated as an instruction and the Dear customer ... block should be treated as data. Further details about the language semantics, grammar, use of special tokens, and converters are provided in llmon/lang/README.md.

Existing LLMON trained models

We provide a model trained on the base LLMON constructs: Granite-4.1-3B-LLMON, finetuned from Granite-4.1-3B-Base to consume LLMON in place of a conventional chat template. It ships a chat_template.jinja, so apply_chat_template renders ordinary messages into LLMON and you never write the markup by hand. Instructions reached through the exec block are treated as authoritative, while data, documents, tool schemas and tool results reached as input are read rather than executed. See the model card for the prompt format, usage and evaluation.

Visualizing Attention over LLMON Blocks

We have a demo that shows, layer by layer, how a model distributes its attention across LLMON blocks: how much lands on the instruction it was asked to execute, how much on the data that instruction operates on, and how much reaches content left unbound. It makes the effect of the markup measurable rather than anecdotal.

Installation

For the general case the model's bundled chat_template.jinja is sufficient — it renders ordinary messages (instructions, data, documents, tool definitions) into LLMON for you, and needs nothing from this repo.

The converters here cover what it does not: turning structured input into LLMON with explicit types and flattened nested tags, so that a JSON document arrives as typed, individually addressable blocks rather than as one opaque string of data. This is the better path whenever the content has structure worth preserving.

To install them, run the following in a virtual environment:

pip install -e .

This makes json-to-llmon, short-to-llmon and the rest available on the command line; see llmon/lang/README.md for details.

Getting started with LLMON

Start with the model card: its prompt format and generation sections carry a complete worked example, from ordinary messages through to the rendered markup. Then read llmon/lang/README.md for the language and its converters, and work through the use cases in llmon/examples/. Those two cover prompts with richer structure and semantic content — extraction, grounded RAG, tool calling, multi-turn — which is where LLMON gives the most over a flat prompt.

Directory structure

  • llmon/lang: contains code and documentation of the LLMON language and converters
  • llmon/plugins: contains
    • VSCode extensions for viewing and converting LLMON and shorthand files
    • emacs extensions for viewing LLMON and shorthand files
  • llmon/examples: contains example use cases of working with LLMON

Paper

The LLMON language and early evaluations are described in this paper.

Metadata

Release files for llmon-core 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llmon-core 0.0.2
File Size Uploaded Provenance Actions
llmon_core-0.0.2.tar.gz 340.6 kB Without provenance Details for llmon_core-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llmon-core 0.0.2
File Interpreter ABI Platform Actions
llmon_core-0.0.2-py3-none-any.whl Python 3 none any Details for llmon_core-0.0.2-py3-none-any.whl

Total release size: 784.0 kB

Release files / llmon_core-0.0.2.tar.gz

Download URL llmon_core-0.0.2.tar.gz
Size 340.6 kB
Tags Source
SHA-256 checksum
How to use checksums
52236f7a37047bfbb80b170b563e7dd31cc317611c11d0c50293a552c52c338a
BLAKE2b-256 checksum
How to use checksums
97d9619c28070a3bc874dd131877211a19ad7f428d55ba321fa4db929a057039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / llmon_core-0.0.2-py3-none-any.whl

Download URL llmon_core-0.0.2-py3-none-any.whl
Size 443.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5e735ada5fb12e63098953ab0f660fd3baf4f86a08267b387b810f5d03a7a51
BLAKE2b-256 checksum
How to use checksums
4b61fe764aa09c8f3aafb652b89f23f9ad1f2fc34e3b349234a80d82061ee86d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for llmon-core 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page