inspector_gguf/lib.rs
1//! # Inspector GGUF
2//!
3//! A powerful GGUF file inspection tool with both graphical and command-line interfaces.
4//! Inspector GGUF provides comprehensive analysis of GGUF (GPT-Generated Unified Format)
5//! model files used in machine learning and AI development.
6//!
7//! ## Features
8//!
9//! - **Deep GGUF Analysis**: Comprehensive metadata extraction and display
10//! - **Modern GUI**: Intuitive interface with drag-and-drop support built with egui
11//! - **Export Capabilities**: Multiple formats (CSV, YAML, Markdown, HTML, PDF)
12//! - **Tokenizer Support**: Chat templates, token analysis, binary data handling
13//! - **Internationalization**: Multi-language support (English, Russian, Portuguese Brazilian)
14//! - **Performance Profiling**: Built-in puffin profiler integration
15//! - **Auto-updates**: Automatic update checking from GitHub releases
16//!
17//! ## Quick Start
18//!
19//! ### As a Library
20//!
21//! ```rust
22//! use inspector_gguf::format::load_gguf_metadata_sync;
23//! use std::path::Path;
24//!
25//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
26//! // Load GGUF metadata from a file
27//! let path = Path::new("model.gguf");
28//! # // Skip actual file loading in doctest
29//! # let metadata: Vec<(String, String)> = Vec::new();
30//! # /*
31//! let metadata = load_gguf_metadata_sync(path)?;
32//! # */
33//!
34//! // Access metadata information
35//! println!("Loaded {} metadata entries", metadata.len());
36//! # Ok(())
37//! # }
38//! ```
39//!
40//! ### GUI Application
41//!
42//! ```rust,no_run
43//! use inspector_gguf::gui::app::GgufApp;
44//! use eframe::NativeOptions;
45//!
46//! # fn main() -> Result<(), eframe::Error> {
47//! let options = NativeOptions::default();
48//! eframe::run_native(
49//! "Inspector GGUF",
50//! options,
51//! Box::new(|_cc| Ok(Box::new(GgufApp::default()))),
52//! )
53//! # }
54//! ```
55//!
56//! ## Module Organization
57//!
58//! - [`mod@format`] - GGUF file parsing and metadata extraction using Candle
59//! - [`format::load_gguf_metadata_sync`] - Synchronous GGUF metadata loading
60//! - [`format::load_gguf_metadata_with_full_content_sync`] - Extended metadata loading with full tokenizer content
61//! - [`format::readable_value_for_key`] - Human-readable value formatting
62//! - [`gui`] - Graphical user interface components built with egui
63//! - [`gui::GgufApp`] - Main application struct implementing [`eframe::App`]
64//! - [`gui::apply_inspector_theme`] - Inspector Gadget theme application
65//! - [`gui::export_csv`], [`gui::export_yaml`], [`gui::export_markdown`] - Multi-format export functions
66//! - [`gui::load_gguf_metadata_async`] - Asynchronous file loading with progress tracking
67//! - [`localization`] - Internationalization system with multi-language support
68//! - [`localization::LocalizationManager`] - Central localization coordinator
69//! - [`localization::Language`] - Supported language enumeration
70//! - [`localization::SystemLocaleDetector`] - Automatic locale detection
71//!
72//! ## Architecture
73//!
74//! Inspector GGUF follows a modular architecture with clear separation of concerns:
75//!
76//! - **Core Parsing**: The [`mod@format`] module handles all GGUF file operations using the [`candle`] framework
77//! - **User Interface**: The [`gui`] module provides immediate-mode GUI components with [`gui::GgufApp`] as the central coordinator
78//! - **Internationalization**: The [`localization`] module manages translations through [`localization::LocalizationManager`] and locale detection via [`localization::SystemLocaleDetector`]
79//!
80//! ## Error Handling
81//!
82//! All public APIs use structured error types that implement [`std::error::Error`].
83//! Error handling follows Rust best practices with detailed error messages and
84//! proper error propagation.
85//!
86//! ## Performance
87//!
88//! Inspector GGUF is designed for efficient handling of large GGUF files:
89//!
90//! - Streaming file parsing to minimize memory usage
91//! - Async operations for non-blocking file loading
92//! - Built-in profiling support with puffin integration
93//! - Optimized data structures for metadata storage
94//!
95//! ## Platform Support
96//!
97//! - **Windows**: Native support with proper resource embedding
98//! - **macOS**: Full compatibility with native file dialogs
99//! - **Linux**: Complete support with system integration
100//!
101//! For more information, see the [GitHub repository](https://github.com/FerrisMind/inspector-gguf).
102
103#![warn(missing_docs)]
104#![warn(rustdoc::broken_intra_doc_links)]
105#![warn(rustdoc::private_intra_doc_links)]
106#![warn(rustdoc::missing_crate_level_docs)]
107#![warn(rustdoc::invalid_codeblock_attributes)]
108
109pub mod format;
110pub mod gui;
111pub mod localization;