1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//! Core types for Nika — zero-dependency provider, model, and MCP definitions.
//!
//! This module provides the canonical definitions for:
//! - **Providers**: LLM providers (Anthropic, OpenAI, etc.) and MCP providers (Neo4j, GitHub, etc.)
//! - **Models**: Curated local models for native inference (mistral.rs)
//! - **MCP Aliases**: Short names → npm package mappings for MCP servers
//! - **Backend**: Backend types for model management (progress, info, config)
//! - **Storage**: HuggingFace model storage with download and checksum verification
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────────────────────┐
//! │ nika::core MODULE │
//! ├─────────────────────────────────────────────────────────────────────────────┤
//! │ │
//! │ providers.rs │
//! │ ├── KNOWN_PROVIDERS: &[Provider] (18 providers) │
//! │ ├── Provider struct (id, name, env_var, key_prefix, category) │
//! │ ├── ProviderCategory enum (Llm, Mcp, Local) │
//! │ └── Helper functions (find_provider, providers_by_category) │
//! │ │
//! │ models.rs │
//! │ ├── KNOWN_MODELS: &[KnownModel] (16+ curated models) │
//! │ ├── KnownModel struct (id, name, architecture, hf_repo, quantizations) │
//! │ ├── ModelType enum (Text, Vision, Embedding, Audio, Diffusion) │
//! │ ├── ModelArchitecture enum (~30 architectures for mistral.rs) │
//! │ └── Helper functions (find_model, resolve_model, auto_select_quantization) │
//! │ │
//! │ mcp_aliases.rs │
//! │ ├── MCP_ALIASES: &[(&str, &str)] (48 aliases) │
//! │ └── Helper functions (resolve_alias, list_aliases) │
//! │ │
//! │ backend.rs │
//! │ ├── PullProgress, ModelInfo, DownloadRequest, DownloadResult │
//! │ ├── LoadConfig, ChatRole, ChatMessage, ChatOptions, ChatResponse │
//! │ └── BackendError enum for error handling │
//! │ │
//! │ storage.rs │
//! │ ├── HuggingFaceStorage for model downloads │
//! │ ├── default_model_dir(), detect_system_ram_gb() │
//! │ └── StorageError, extract_quantization() │
//! │ │
//! └─────────────────────────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Architecture
//!
//! This is the core module for Nika. All provider, model, and MCP
//! definitions are defined directly in this module with zero external dependencies.
//!
//! ## Usage
//!
//! ```rust,ignore
//! use nika::core::{KNOWN_PROVIDERS, find_provider, ProviderCategory};
//! use nika::core::{KNOWN_MODELS, find_model, ModelType};
//! use nika::core::{MCP_ALIASES, resolve_alias};
//!
//! // Find a provider
//! let anthropic = find_provider("anthropic").unwrap();
//! assert_eq!(anthropic.env_var, "ANTHROPIC_API_KEY");
//!
//! // Find a model
//! let qwen = find_model("qwen3:8b").unwrap();
//! assert_eq!(qwen.param_billions, 8.0);
//!
//! // Resolve MCP alias
//! let pkg = resolve_alias("neo4j").unwrap();
//! assert_eq!(pkg, "@neo4j/mcp-server-neo4j");
//! ```
// ── Catalog modules (from nika-core) ────────────────────────────────────────
// Pure data: types, statics, lookup functions. Zero runtime dependencies.
pub use mcp_aliases;
pub use providers;
// Models: catalog types from nika-core + runtime functions in local models.rs
// ── Local modules (runtime dependencies) ────────────────────────────────────
// Re-export main types for convenient access
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Path utilities
pub use ;
// Note: global_config_path is exported from paths module but accessed via paths::global_config_path
// to avoid conflict with mcp_config::global_config_path