Skip to main content

gglib_core/domain/
mod.rs

1#![doc = include_str!("README.md")]
2pub(crate) mod admission;
3pub mod agent;
4pub mod benchmark;
5pub(crate) mod cache_budget;
6pub mod capabilities;
7pub mod capability_tags;
8pub mod chat;
9mod context_fit;
10pub mod defect_counts;
11pub mod defects;
12pub mod dialect;
13pub(crate) mod generation_config;
14pub mod gguf;
15pub(crate) mod inference;
16pub mod inference_profile;
17pub(crate) mod kv_estimate;
18pub(crate) mod kv_memory;
19pub(crate) mod launch_narration;
20pub mod loop_guard_log;
21pub mod mcp;
22mod model;
23pub(crate) mod model_naming;
24pub(crate) mod model_sampling;
25pub(crate) mod query;
26pub(crate) mod reasoning_effort;
27pub mod recommendation;
28pub(crate) mod residency;
29pub(crate) mod runtime_capabilities;
30pub(crate) mod sampling_discards;
31pub(crate) mod sampling_provenance;
32mod server_config;
33pub mod slot_eviction;
34pub(crate) mod template_caps;
35
36// Re-export model types at the domain level for convenience
37pub use model::{Model, ModelFile, ModelFilterOptions, NewModel, NewModelFile};
38
39// Re-export query types at the domain level for convenience
40pub use query::{ModelListQuery, ModelSortBy, SortOrder, apply_query};
41
42// Re-export benchmark types at the domain level for convenience
43pub use benchmark::{
44    BenchmarkEvent, BenchmarkModelResult, BenchmarkRun, BenchmarkRunStatus, BenchmarkRunType,
45    CandidateSource, CompareConfig, GeneratedOutput, ModelBenchmarkSummary, ModelCompareResult,
46    ModelPerfResult, PerfConfig, ScoreWeights, SweepSpec, TaskCategory, TaskSuite,
47    TuneCandidateResult, TuneConfig, TuneTask, TuneTaskResult,
48};
49
50// Re-export inference types at the domain level for convenience
51pub use capability_tags::is_reasoning;
52pub use inference::{DefaultsOrigin, FieldIssue, InferenceConfig, ModelSamplingContext};
53pub use inference_profile::{InferenceProfile, builtin_templates};
54pub use reasoning_effort::ReasoningEffort;
55
56// Re-export sampling provenance types at the domain level for convenience
57pub use sampling_discards::discarded_from_rung;
58pub use sampling_provenance::{FieldSources, ParamSource, SamplingLayer};
59
60// Re-export runtime (llama-server) capability detection at the domain level
61pub use runtime_capabilities::{RuntimeCapabilities, RuntimeFlags};
62
63// Re-export the template-capability self-report (ADR 0007) at the domain level
64pub use template_caps::{Support, TemplateCaps, TemplateCapsState, reasoning_effort_support};
65
66// Re-export KV estimation helpers at the domain level for convenience
67pub use kv_estimate::{
68    KvElemsPerToken, estimate_kv_bytes_for_context, estimate_kv_elems_per_token, kv_bytes_per_token,
69};
70
71// Re-export KV memory-shape detection at the domain level for convenience
72pub use kv_memory::{kv_cache_layer_count, kv_memory_is_partial};
73pub use model_sampling::{
74    MODEL_SAMPLING_KEYS, ModelSamplingDefault, ModelSamplingDefaults, SamplingOverride,
75};
76
77// Re-export launch narration types at the domain level for convenience
78pub use launch_narration::{LaunchDecision, LaunchNarration, format_gib, format_mib_as_gib};
79
80// Re-export the first-run model recommendation at the domain level.
81pub use recommendation::BUDGET_UTILISATION;
82pub use recommendation::{BudgetSource, Recommendation, recommend};
83
84// Re-export admission-control telemetry at the domain level for convenience
85pub use admission::{
86    AdmissionSnapshot, QueuedModelSnapshot, ResidentSlotSnapshot, SecondarySlotStatus,
87};
88
89// Re-export the second-VRAM-slot decision at the domain level for convenience
90pub use residency::{
91    RESIDENCY_UTILISATION, SecondarySlotDecision, SlotFootprint, decide_secondary_slot,
92};
93pub use server_config::ServerConfig;
94
95// Re-export cache-RAM budget math at the domain level for convenience
96pub use cache_budget::{
97    CACHE_RAM_UNKNOWN_KV_ALLOWANCE_BYTES, CacheRamHealth, classify_cache_ram,
98    compute_auto_cache_ram_mb,
99};
100
101// Re-export slot eviction helpers at the domain level for convenience
102pub use slot_eviction::{SlotFileMeta, compute_auto_disk_budget_bytes, select_evictions};
103
104// Re-export MCP types at the domain level for convenience
105pub use mcp::{
106    McpEnvEntry, McpLifecycle, McpServer, McpServerConfig, McpServerStatus, McpServerType, McpTool,
107    McpToolResult, NewMcpServer, ToolIndex,
108};
109
110// Re-export chat types at the domain level for convenience
111pub use chat::{
112    Conversation, ConversationUpdate, Message, MessageRole, NewConversation, NewMessage,
113};
114
115// Re-export GGUF types at the domain level for convenience
116pub use gguf::{CapabilityFlags, GgufCapabilities, GgufMetadata, GgufValue, RawMetadata};
117
118// Re-export dialect types at the domain level for convenience
119pub use dialect::{BodyCodec, DialectSpec, EmissionProfile};
120
121// Re-export model-naming types at the domain level for convenience
122pub use model_naming::{NameSource, repo_short_name, resolve_model_name, strip_gguf_suffix};
123
124// Re-export agent types at the domain level for convenience
125pub use agent::{
126    AGENT_EVENT_CHANNEL_CAPACITY, AgentConfig, AgentEvent, AgentMessage, AssistantContent,
127    DEFAULT_MAX_ITERATIONS, DEFAULT_MAX_STAGNATION_STEPS, LlmStreamEvent, LoopDetector,
128    MAX_ITERATIONS_CEILING, MAX_PARALLEL_TOOLS_CEILING, MAX_TOOL_TIMEOUT_MS_CEILING,
129    StagnationDetector, ToolCall, ToolDefinition, ToolResult,
130};
131
132// Re-export capability types at the domain level for convenience
133pub use capabilities::capabilities_from_architecture;
134pub use capabilities::infer_from_chat_template;
135pub use capabilities::{
136    ChatMessage, MessageContent, ModelCapabilities, transform_messages_for_capabilities,
137};
138pub use context_fit::{FitInputs, fit_context, fit_context_explained};
139pub use generation_config::generation_config_candidates;
140pub use generation_config::parse_generation_config;
141pub use model::RangeValues;
142pub use model::is_system_tag;
143pub use model_naming::declared_name;