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.
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.
- π₯ 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
file β reader thread β channel β N worker threads β channel β windowed aggregator β CSV
- Ownership is transferred through channels
- No
Arc<Mutex<T>> - Channels provide backpressure and graceful shutdown
This mirrors real production ingestion pipelines.
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
Each line is a JSON log event:
{"timestamp":"2025-11-08T10:00:00Z","level":"INFO","latency_ms":120}window_start,window_end,request_count,avg_latency
2025-11-08T10:00:00Z,2025-11-08T10:05:00Z,842,124.6This file can be loaded directly into Pandas, Spark, or ML training pipelines.
| Use Case | Approach |
|---|---|
| Real-time ingestion | Channels + threads |
| Offline dataset prep | Rayon |
The project includes both implementations and benchmarks comparing them.
Benchmarks are implemented using Criterion:
cargo benchThey compare:
- Channel-based streaming parsing
- Rayon-based batch parsing
- Rust ownership & lifetimes by design
- Safe concurrency without locks
- Backend data pipeline architecture
- AI/ML feature engineering awareness
- Performance measurement, not guesswork
- Rust
- clap
- serde / serde_json
- chrono
- csv
- rayon
- criterion
- crossbeam-channel
- log
- env_logger
- arrow
- Parquet export
- Prometheus metrics
- Async I/O
- Sliding windows