Skip to main content

el_core/
lib.rs

1//! `el-core` — the shared, dependency-free domain vocabulary for the
2//! Edge-Native LLM SDK.
3//!
4//! Everything here is the *ubiquitous language* made into Rust types
5//! (`docs/ddd/ubiquitous-language.md`). It has **no external dependencies** so
6//! it compiles offline on any target, including `wasm32` (ADR-008).
7//!
8//! Cross-cutting invariants encoded here:
9//! - **Content-free events (ADR-007):** [`events::DomainEvent`] derives `Copy`,
10//!   which makes the compiler reject any `String`/`Vec`/heap field — so no
11//!   prompt or response content can ever ride on an event.
12//! - **Air-gap by default (ADR-004):** [`config::SessionConfig::hybrid_mode`]
13//!   defaults to `false`; the only network seam is an explicit opt-in.
14//! - **Unified LLM provider (ADR-010):** [`provider::LlmProvider`] covers both
15//!   local Candle and cloud frontier backends behind one trait.
16
17#![forbid(unsafe_code)]
18
19pub mod config;
20pub mod error;
21pub mod events;
22pub mod ids;
23pub mod provider;
24pub mod value_objects;
25
26pub use config::SessionConfig;
27pub use error::{EdgeError, Result};
28pub use events::{DegradeReason, DomainEvent, EventEnvelope};
29pub use ids::{ModelId, ModelVersion, SessionId};
30pub use provider::{
31    ChatMessage, ChatRequest, ChatResponse, ChatRole, ChatToken, CredentialRef, LlmProvider,
32};
33pub use value_objects::{
34    DeviceTarget, ModelFormat, Phase, RuntimeKind, SafetyMode, SpeculationMode, StopReason, Token,
35};