@kernel.chat/kbot 3.99.16 → 3.99.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/auth.js +19 -0
  2. package/package.json +1 -1
package/dist/auth.js CHANGED
@@ -460,6 +460,13 @@ function isModelAvailable(model, available) {
460
460
  /** Select the best Ollama model for a given message, only from available models */
461
461
  export function selectOllamaModel(message, availableModels) {
462
462
  const available = availableModels || cachedOllamaModels;
463
+ // If the user has set a local_model in config, honor it — smart routing
464
+ // should never silently override the user's explicit choice. Only fall back
465
+ // to keyword routing when no config is set.
466
+ const userConfiguredModel = loadConfigRaw().local_model;
467
+ if (userConfiguredModel && (available.length === 0 || isModelAvailable(userConfiguredModel, available))) {
468
+ return userConfiguredModel;
469
+ }
463
470
  if (available.length === 0)
464
471
  return PROVIDERS.ollama.defaultModel;
465
472
  for (const route of OLLAMA_MODEL_ROUTES) {
@@ -884,6 +891,18 @@ export function classifyComplexity(message) {
884
891
  export function routeModelForTask(provider, message) {
885
892
  const complexity = classifyComplexity(message);
886
893
  const p = PROVIDERS[provider];
894
+ // For Ollama, honor the user's configured local_model / fast_model before
895
+ // falling back to the hardcoded provider defaults. Otherwise smart routing
896
+ // silently picks a different model than `kbot doctor` reports.
897
+ if (provider === 'ollama') {
898
+ const cfg = loadConfigRaw();
899
+ if ((complexity === 'trivial' || complexity === 'simple') && cfg.fast_model) {
900
+ return { model: cfg.fast_model, reason: `${complexity} task → user's fast_model` };
901
+ }
902
+ if (cfg.local_model) {
903
+ return { model: cfg.local_model, reason: `${complexity} task → user's local_model` };
904
+ }
905
+ }
887
906
  switch (complexity) {
888
907
  case 'trivial':
889
908
  case 'simple':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernel.chat/kbot",
3
- "version": "3.99.16",
3
+ "version": "3.99.18",
4
4
  "description": "Open-source terminal AI agent. 787+ tools, 35 agents, 20 providers. Dreams, learns, watches your system. Controls your phone. Fully local, fully sovereign. MIT.",
5
5
  "type": "module",
6
6
  "repository": {