Skip to main content

gglib_core/domain/
mod.rs

1#![doc = include_str!("README.md")]
2pub mod admission;
3pub mod agent;
4pub mod benchmark;
5pub mod cache_budget;
6pub mod capabilities;
7pub mod chat;
8pub mod gguf;
9pub mod inference;
10pub mod inference_profile;
11pub mod kv_estimate;
12pub mod kv_memory;
13pub mod launch_narration;
14pub mod mcp;
15mod model;
16pub mod model_naming;
17pub mod query;
18pub mod recommendation;
19pub mod residency;
20pub mod sampling_provenance;
21mod server_config;
22pub mod slot_eviction;
23
24// Re-export model types at the domain level for convenience
25pub use model::{
26    Model, ModelFile, ModelFilterOptions, NewModel, NewModelFile, RangeValues, SYSTEM_TAG_PREFIX,
27    is_system_tag,
28};
29
30// Re-export query types at the domain level for convenience
31pub use query::{ModelListQuery, ModelSortBy, SortOrder, apply_query};
32
33// Re-export benchmark types at the domain level for convenience
34pub use benchmark::{
35    BenchmarkEvent, BenchmarkModelResult, BenchmarkRun, BenchmarkRunStatus, BenchmarkRunType,
36    CandidateSource, CompareConfig, ModelBenchmarkSummary, ModelCompareResult, ModelPerfResult,
37    PerfConfig, ScoreWeights, SweepSpec, TaskCategory, TaskSuite, TuneCandidateResult, TuneConfig,
38    TuneTask, TuneTaskResult,
39};
40
41// Re-export inference types at the domain level for convenience
42pub use inference::{DefaultsOrigin, InferenceConfig, ModelSamplingContext};
43pub use inference_profile::{
44    InferenceProfile, MAX_PROFILE_NAME_LEN, ProfileNameError, RESERVED_PROFILE_NAMES,
45    builtin_templates, validate_name,
46};
47
48// Re-export sampling provenance types at the domain level for convenience
49pub use sampling_provenance::{FieldSources, ParamSource, SamplingLayer};
50
51// Re-export KV estimation helpers at the domain level for convenience
52pub use kv_estimate::{
53    KvElemsPerToken, estimate_kv_bytes_for_context, estimate_kv_elems_per_token, kv_bytes_per_token,
54};
55
56// Re-export KV memory-shape detection at the domain level for convenience
57pub use kv_memory::kv_memory_is_partial;
58
59// Re-export launch narration types at the domain level for convenience
60pub use launch_narration::{LaunchDecision, LaunchNarration, format_gib, format_mib_as_gib};
61
62// Re-export the first-run model recommendation at the domain level.
63pub use recommendation::{BudgetSource, ModelCandidate, Recommendation, recommend};
64
65// Re-export admission-control telemetry at the domain level for convenience
66pub use admission::{
67    AdmissionSnapshot, QueuedModelSnapshot, ResidentSlotSnapshot, SecondarySlotStatus,
68};
69
70// Re-export the second-VRAM-slot decision at the domain level for convenience
71pub use residency::{
72    RESIDENCY_UTILISATION, SECONDARY_MAX_BYTES, SecondarySlotDecision, SlotFootprint,
73    decide_secondary_slot,
74};
75pub use server_config::ServerConfig;
76
77// Re-export cache-RAM budget math at the domain level for convenience
78pub use cache_budget::{
79    CACHE_RAM_FLOOR_BYTES, CACHE_RAM_HEADROOM_BYTES, CACHE_RAM_LOW_WATERMARK_BYTES,
80    CACHE_RAM_UNKNOWN_KV_ALLOWANCE_BYTES, CacheRamHealth, classify_cache_ram,
81    compute_auto_cache_ram_mb,
82};
83
84// Re-export slot eviction helpers at the domain level for convenience
85pub use slot_eviction::{
86    DISK_BUDGET_FRACTION_DIVISOR, SlotFileMeta, compute_auto_disk_budget_bytes, select_evictions,
87};
88
89// Re-export MCP types at the domain level for convenience
90pub use mcp::{
91    McpEnvEntry, McpLifecycle, McpServer, McpServerConfig, McpServerStatus, McpServerType, McpTool,
92    McpToolResult, NewMcpServer, SEARCH_RESULTS_CAP, ToolIndex, ToolSummary, UpdateMcpServer,
93};
94
95// Re-export chat types at the domain level for convenience
96pub use chat::{
97    Conversation, ConversationUpdate, Message, MessageRole, NewConversation, NewMessage,
98};
99
100// Re-export GGUF types at the domain level for convenience
101pub use gguf::{
102    CapabilityFlags, GgufCapabilities, GgufMetadata, GgufValue, RawMetadata, ReasoningDetection,
103    ToolCallingDetection,
104};
105
106// Re-export model-naming types at the domain level for convenience
107pub use model_naming::{
108    NameSource, UNKNOWN_MODEL_NAME, declared_name, repo_short_name, resolve_model_name,
109    strip_gguf_suffix,
110};
111
112// Re-export agent types at the domain level for convenience
113pub use agent::{
114    AGENT_EVENT_CHANNEL_CAPACITY, AgentConfig, AgentConfigError, AgentEvent, AgentMessage,
115    AssistantContent, DEFAULT_MAX_ITERATIONS, DEFAULT_MAX_PARALLEL_TOOLS,
116    DEFAULT_MAX_STAGNATION_STEPS, LlmStreamEvent, MAX_ITERATIONS_CEILING,
117    MAX_PARALLEL_TOOLS_CEILING, MAX_TOOL_TIMEOUT_MS_CEILING, MIN_CONTEXT_BUDGET_CHARS,
118    MIN_TOOL_TIMEOUT_MS, ToolCall, ToolDefinition, ToolResult,
119};
120
121// Re-export capability types at the domain level for convenience
122pub use capabilities::{
123    ChatMessage, MessageContent, ModelCapabilities, capabilities_from_architecture,
124    infer_from_chat_template, transform_messages_for_capabilities,
125};