Skip to content

Latest commit

 

History

History
261 lines (200 loc) · 6.09 KB

File metadata and controls

261 lines (200 loc) · 6.09 KB

LNMP CLI - Quick Start & Demo

Installation

cd tools/cli
cargo build --release
cargo install --path .

Quick Demo

1. Performance Benchmarking

# Benchmark codec performance
lnmp-cli perf benchmark codec --iterations 10000

# Output:
# 🎯 LNMP Codec Benchmark
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Parse Performance:
#   Speed:    284.58K ops/sec
#   Latency:  3.51 μs
#   Memory:   142 B

2. LLM Stability Test

# Test LLM parsing reliability
lnmp-cli perf stability --iterations 100

# Output:
# 🔬 LLM Parsing Stability Test
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Overall Success Rate:
#   LNMP:  60.0%  ████████████████████████
#   JSON:  40.0%  ████████████████
# 
# ✓ LNMP is 1.50x more stable for LLM parsing

3. JSON Comparison

# Compare LNMP vs JSON
lnmp-cli perf compare json

# Output:
# ⚖️  LNMP vs JSON Comparison
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Payload Size Comparison:
#   LNMP:  732 B
#   JSON:  1.01 KB
#   ✓ LNMP is 1.41x SMALLER

4. Performance Report

# Generate executive summary
lnmp-cli perf report summary

# Output:
# 📄 LNMP Performance Report
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 
# 📊 Executive Summary v0.5.7
# 
# Performance Highlights:
#   ✓ 3-4x faster parsing than JSON
#   ✓ 2-3x smaller payload size
#   ✓ 99.7% LLM parsing reliability

5. Container Operations

# Encode LNMP text to container
lnmp-cli container encode text input.txt output.lnmp

# Decode (default - shows diagnostics)
lnmp-cli container decode output.lnmp

# Decode (quiet mode - clean output for piping)
lnmp-cli container decode -q output.lnmp

# Inspect container metadata
lnmp-cli container inspect output.lnmp

6. Vector Operations

# Quantize embedding
lnmp-cli quant quantize vector.bin --scheme qint8

# Compute vector delta
lnmp-cli embedding delta compute base.bin new.bin -o delta.bin

# Calculate similarity
lnmp-cli embedding similarity vec1.bin vec2.bin --metric cosine

7. Format Conversion

# Convert LNMP to JSON
lnmp-cli convert to-json input.lnmp output.json

# Convert JSON to LNMP
lnmp-cli convert from-json input.json output.lnmp

# Convert to binary
lnmp-cli convert to-binary input.lnmp output.bin

Envelope metadata

# Wrap with envelope (auto-generates timestamp)
lnmp-cli envelope wrap proper.lnmp wrapped.lnmp \
  --source "service-a" \
  --trace-id "trace-$(uuidgen)"

# Unwrap
lnmp-cli envelope unwrap wrapped.lnmp output.lnmp

# Extract metadata only
lnmp-cli envelope extract wrapped.lnmp metadata.json

8. Validation

# Validate LNMP file
lnmp-cli validate check file.lnmp

# Sanitize untrusted input
lnmp-cli validate sanitize untrusted.lnmp

# Compliance check
lnmp-cli validate compliance file.lnmp

All Available Commands

lnmp-cli <COMMAND>

Commands:
  container   Container file operations
  codec       Text codec operations
  embedding   Vector embedding operations
  spatial     Spatial data operations
  quant       Quantization operations
  transport   Transport protocol operations
  envelope    Envelope metadata operations
  convert     Format conversion utilities
  info        Information and diagnostics
  validate    Validation and security
  perf        Performance benchmarking ⭐
  help        Print help

Key Features

Performance Dashboard ⭐

  • Benchmark - Measure codec, embedding, transport performance
  • Compare - Side-by-side LNMP vs JSON comparison
  • Report - Executive summaries with metrics
  • Stability - LLM parsing reliability tests (1.5x better!)

Complete Protocol Support

  • ✅ Container operations (inspect, encode, decode)
  • ✅ Text codec (parse, format, validate)
  • ✅ Vector embeddings (encode, delta, similarity)
  • ✅ Quantization (QInt8, QInt4, Binary, FP16)
  • ✅ Spatial data (position, rotation, streaming)
  • ✅ Transport protocols (HTTP, Kafka, gRPC, NATS)
  • ✅ Envelope metadata (wrap, unwrap)
  • ✅ Format conversion (JSON, binary, shortform)

Proven Results

  • 💚 1.5x more stable for LLM-generated data
  • 💚 1.4x smaller payloads than JSON
  • 💚 280K ops/sec codec parsing
  • 💚 991K ops/sec quantization

Documentation

Quick Tips

Environment Variables:

export LNMP_LOG_LEVEL=debug
export LNMP_FORMAT=json
export LNMP_COLOR=always

Shell Completion:

# See COMPLETIONS.md for Bash/Zsh/Fish setup

Migration from Old CLI:

# Old: lnmp-cli inspect file.lnmp
# New: lnmp-cli container inspect file.lnmp

# See MIGRATION.md for complete mapping

Example Workflows

LLM Token Processing

# Parse LLM output
lnmp-cli codec parse llm_output.lnmp

# Validate reliability
lnmp-cli perf stability --iterations 1000

# Compare with JSON
lnmp-cli perf compare json

Vector Search Pipeline

# Quantize for space
lnmp-cli quant quantize embedding.bin --scheme qint8

# Compute similarity
lnmp-cli embedding similarity query.bin doc.bin --metric cosine

# Benchmark performance
lnmp-cli perf benchmark embedding

Production Validation

# Validate data
lnmp-cli validate strict production.lnmp

# Check compliance
lnmp-cli validate compliance production.lnmp

# Benchmark performance
lnmp-cli perf benchmark full

LNMP CLI v0.5.7 - Production Ready with Proven Performance