Skip to main content

Module llm

Module llm 

Source
Expand description

DX Serializer LLM Format Module

This module provides support for multiple interconvertible formats:

§DX Serializer Format (Token-Efficient LLM Format)

A token-efficient serialization format optimized for LLMs:

  • key=value for simple key-value pairs
  • name(key=val key2=val2) for objects (parentheses, space-separated)
  • name[col1 col2 col3](rows) for tables (wrapped dataframe format)
  • key=[item1 item2 item3] for arrays (square brackets, space-separated)
  • true/false for booleans, null for null values
  • Use quotes "..." for multi-word strings

§Human Format (Clean TOML-like)

Clean, hand-editable format:

  • = for single scalar values
  • : + - lines for arrays
  • # for comments
  • Nested sections like [stack.js]

§Machine Format

Binary format for runtime using RKYV’s zero-copy architecture.

The architecture follows a “hub and spoke” model where all formats convert through a common internal representation (DxDocument), ensuring consistent round-trip behavior.

Re-exports§

pub use abbrev::AbbrevDict;
pub use cache_generator::CacheConfig;
pub use cache_generator::CacheError;
pub use cache_generator::CacheGenerator;
pub use cache_generator::CachePaths;
pub use cache_generator::CacheResult;
pub use convert::ConvertError;
pub use convert::MachineFormat;
pub use convert::document_to_human;
pub use convert::document_to_llm;
pub use convert::document_to_machine;
pub use convert::human_to_document;
pub use convert::human_to_llm;
pub use convert::human_to_machine;
pub use convert::human_to_machine_uncompressed;
pub use convert::is_llm_format;
pub use convert::llm_to_document;
pub use convert::llm_to_human;
pub use convert::llm_to_machine;
pub use convert::machine_bytes_to_document;
pub use convert::machine_to_document;
pub use convert::machine_to_human;
pub use convert::machine_to_llm;
pub use convert::try_document_to_machine_with_compression;
pub use human_formatter::HumanFormatConfig;
pub use human_formatter::HumanFormatter;
pub use human_parser::HumanParseError;
pub use human_parser::HumanParser;
pub use machine_zerocopy::ZeroCopyDocument;
pub use machine_zerocopy::ZeroCopyError;
pub use machine_zerocopy::ZeroCopyMachine;
pub use parser::LlmParser;
pub use parser::ParseError;
pub use pretty_printer::PrettyPrintError;
pub use pretty_printer::PrettyPrinter;
pub use pretty_printer::PrettyPrinterConfig;
pub use section_names::SectionNameDict;
pub use serializer::LlmSerializer;
pub use serializer::SerializerConfig;
pub use serializer_output::SerializerOutput;
pub use serializer_output::SerializerOutputConfig;
pub use serializer_output::SerializerOutputError;
pub use serializer_output::SerializerPaths;
pub use serializer_output::SerializerResult;
pub use table_wrapper::TableWrapper;
pub use table_wrapper::TableWrapperConfig;
pub use tokens::ModelType;
pub use tokens::TokenCounter;
pub use tokens::TokenInfo;
pub use types::DxDocument;
pub use types::DxLlmValue;
pub use types::DxSection;

Modules§

abbrev
Key abbreviation dictionary for LLM and Human format conversion
cache_generator
Cache Generator for DX Serializer
convert
Format conversion functions
human_formatter
Human Format Formatter
human_parser
Human format parser
machine_zerocopy
Zero-copy machine format implementation
parser
DX Serializer LLM Format Parser
pretty_printer
Pretty Printer for Human Format
section_names
Section name dictionary for Human V3 format conversion
serializer
DX Serializer LLM Format
serializer_output
Serializer Output Module for DX Serializer
table_wrapper
Table Wrapper for Wide Tables
tokens
Token counting for LLM serializer output
types
Core data types for LLM and Human format serialization