use pyo3::prelude::*;

/// Unified LLMHosts Python extension module.
///
/// Re-exports all Rust crates as submodules:
///   _llmhosts.core   -- inference engine (GGUF, transformer, generation)
///   _llmhosts.gpu    -- GPU detection (NVIDIA, AMD, Apple, Intel)
///   _llmhosts.relay  -- tunnel client (WebSocket relay)
///   _llmhosts.router -- kNN router + privacy classification
#[pymodule]
fn _llmhosts(m: &Bound<'_, PyModule>) -> PyResult<()> {
    // Core inference engine
    let core = PyModule::new(m.py(), "core")?;
    _llmhosts_core::register_module(&core)?;
    m.add_submodule(&core)?;

    // GPU detection
    let gpu = PyModule::new(m.py(), "gpu")?;
    _llmhosts_gpu::register_module(&gpu)?;
    m.add_submodule(&gpu)?;

    // Relay tunnel client
    let relay = PyModule::new(m.py(), "relay")?;
    _relay_core::register_module(&relay)?;
    m.add_submodule(&relay)?;

    // kNN router + privacy
    let router = PyModule::new(m.py(), "router")?;
    _router_core::register_module(&router)?;
    m.add_submodule(&router)?;

    // Top-level version
    m.add("__version__", env!("CARGO_PKG_VERSION"))?;

    Ok(())
}
