Skip to content

honourable12/logsmith-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logsmith-ai

A high-performance Rust backend pipeline that ingests structured logs, processes them concurrently, and produces time-windowed features suitable for AI/ML training and monitoring.


πŸš€ Why This Project Exists

Modern AI systems depend on reliable, high-throughput data ingestion pipelines. Raw logs must be:

  • Parsed safely
  • Processed concurrently
  • Aggregated into fixed-size feature windows
  • Exported in ML-friendly formats

logsmith-ai implements this end-to-end in safe, idiomatic Rust.


✨ Features

  • πŸ“₯ Streaming ingestion of large log files
  • 🧡 Multi-threaded parsing using message-passing (no shared mutable state)
  • ⏱️ Time-windowed feature aggregation
  • πŸ“€ CSV/Parquet export for ML training pipelines
  • ⚑ Batch parallelism using Rayon (offline workloads)
  • πŸ“Š Benchmarks using Criterion

πŸ—οΈ Architecture Overview

file β†’ reader thread β†’ channel β†’ N worker threads β†’ channel β†’ windowed aggregator β†’ CSV

Concurrency Model

  • Ownership is transferred through channels
  • No Arc<Mutex<T>>
  • Channels provide backpressure and graceful shutdown

This mirrors real production ingestion pipelines.


πŸ“¦ Project Structure

logsmith-ai/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ ingest/        # File reading & parsing
β”‚   β”œβ”€β”€ pipeline/      # Channel & Rayon pipelines
β”‚   β”œβ”€β”€ features/      # Feature extraction & windowing
β”‚   β”œβ”€β”€ output/        # CSV export
β”‚   └── main.rs
β”œβ”€β”€ benches/           # Criterion benchmarks
└── tests/             # End-to-end tests

πŸ§ͺ Example Input

Each line is a JSON log event:

{"timestamp":"2025-11-08T10:00:00Z","level":"INFO","latency_ms":120}

πŸ“Š Example Output (CSV)

window_start,window_end,request_count,avg_latency
2025-11-08T10:00:00Z,2025-11-08T10:05:00Z,842,124.6

This file can be loaded directly into Pandas, Spark, or ML training pipelines.


⚑ Streaming vs Batch Processing

Use Case Approach
Real-time ingestion Channels + threads
Offline dataset prep Rayon

The project includes both implementations and benchmarks comparing them.


πŸ“Š Benchmarks

Benchmarks are implemented using Criterion:

cargo bench

They compare:

  • Channel-based streaming parsing
  • Rayon-based batch parsing

🧠 What This Demonstrates

  • Rust ownership & lifetimes by design
  • Safe concurrency without locks
  • Backend data pipeline architecture
  • AI/ML feature engineering awareness
  • Performance measurement, not guesswork

πŸ› οΈ Tech Stack

  • Rust
  • clap
  • serde / serde_json
  • chrono
  • csv
  • rayon
  • criterion
  • crossbeam-channel
  • log
  • env_logger
  • arrow

πŸ“Œ Future Improvements

  • Parquet export
  • Prometheus metrics
  • Async I/O
  • Sliding windows

About

high-performance rust πŸ¦€ backend pipeline that ingests structured logs, processes them concurrently

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages