@kernel.chat/kbot 3.99.8 → 3.99.9

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 +26 -0
  2. package/package.json +1 -1
package/dist/auth.js CHANGED
@@ -490,8 +490,34 @@ export function getProviderModel(provider, speed, taskHint) {
490
490
  if (provider === 'ollama' && speed === 'default' && taskHint) {
491
491
  return selectOllamaModel(taskHint);
492
492
  }
493
+ // Respect user's configured local_model (Ollama) / fast_model / thinking_model
494
+ // from ~/.kbot/config.json BEFORE falling back to hardcoded defaults.
495
+ if (provider === 'ollama') {
496
+ try {
497
+ const cfg = loadConfigRaw();
498
+ if (speed === 'fast' && cfg.fast_model)
499
+ return cfg.fast_model;
500
+ if (speed === 'default' && cfg.local_model)
501
+ return cfg.local_model;
502
+ }
503
+ catch { /* config missing — fall through */ }
504
+ }
493
505
  return speed === 'fast' ? p.fastModel : p.defaultModel;
494
506
  }
507
+ /** Lightweight config read — avoids circular dep with full loadConfig. */
508
+ function loadConfigRaw() {
509
+ try {
510
+ const { readFileSync } = require('node:fs');
511
+ const { join } = require('node:path');
512
+ const { homedir } = require('node:os');
513
+ const path = join(homedir(), '.kbot', 'config.json');
514
+ const content = readFileSync(path, 'utf-8');
515
+ return JSON.parse(content);
516
+ }
517
+ catch {
518
+ return {};
519
+ }
520
+ }
495
521
  /** Get the provider API URL */
496
522
  export function getProviderUrl(provider) {
497
523
  return PROVIDERS[provider].apiUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernel.chat/kbot",
3
- "version": "3.99.8",
3
+ "version": "3.99.9",
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": {