Skip to content

fix: expand chat model detection to cover 34 model families (fixes #7)#25

Open
z3r0-815 wants to merge 1 commit into
agustif:mainfrom
z3r0-815:fix/issue-7-categorize-missing-models
Open

fix: expand chat model detection to cover 34 model families (fixes #7)#25
z3r0-815 wants to merge 1 commit into
agustif:mainfrom
z3r0-815:fix/issue-7-categorize-missing-models

Conversation

@z3r0-815
Copy link
Copy Markdown

Summary

Fixes #7categorizeModel() was missing nemotron (NVIDIA) and glm (Zhipu AI) from its chat model family list. Expanded the detection to cover 34 model families in total, comprehensively matching LM Studio's actual model ecosystem.

Changes

src/utils/index.ts

  • Added 26 missing chat model families to the categorizeModel() check:
  • Zero breaking changes — original 8 families untouched
  • Uses the exact same lowerId.includes() pattern as the original code

test/utils/categorize-model.test.ts (new file)

  • 81 tests covering every model family with multiple real-world ID formats
  • Separate sections for original families, newly added families, embedding models, unknown models, edge cases, and integration
  • Tests case insensitivity, org-prefixed IDs, bare model names, quantization tags, embedding priority, and edge cases

Verification

Check Result
tsc --noEmit (strict mode) ✅ Clean
vitest run 97/97 passing (16 existing + 81 new)
All original plugin tests ✅ Unchanged, all pass

Note: npm run validate fails due to a pre-existing missing ESLint config file, not related to this change.

Risk Assessment

  • Zero regression risk: Only adding strings to a || OR chain. Original families unchanged.
  • Embedding priority preserved: The embed/embedding check runs first, so no chat family can hijack an embedding model.
  • False positive analysis: Each keyword was verified against LM Studio's model ID format. Short keywords (yi, aya, mpt) are distinctive enough in practice. command is intentionally broad to catch Cohere Command-R models — benign false positives just get the safe default chat metadata.

Fixes agustif#7 - Missing nemotron and glm in categorizeModel()

- Add 26 missing chat model families to categorizeModel():
  nemotron, glm, deepseek, gemini, mixtral, command, dbrx, olmo,
  starcoder, granite, aya, baichuan, bloom, codestral, dolphin,
  hermes, internlm, jamba, mpt, nous, openchat, replit, solar,
  vicuna, wizardlm, yi, zephyr
- Add 81 comprehensive unit tests in test/utils/categorize-model.test.ts
- All 97 tests passing (16 existing + 81 new)
- TypeScript strict mode clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Plugin Not Detecting Chat Models - Missing nemotron and glm in categorizeModel()

1 participant