Skip to content

Model Metatdata with controls - #91

Merged
mbeps merged 2 commits into
mainfrom
dev
May 28, 2026
Merged

mbeps merged 2 commits into
mainfrom
dev

Conversation

@mbeps

@mbeps mbeps commented May 28, 2026

Copy link
Copy Markdown
Owner

This pull request introduces robust capability gating for AI models, ensuring that features like image (vision) and tool support are only available if the selected model supports them. The changes affect both backend request handling and frontend UI, enhancing user experience and preventing unsupported actions. Additionally, tests are added to verify model capability logic.

Capability Gating and Enforcement

  • The backend chat API (app/api/chat/route.ts) now filters out image attachments and disables tool usage for models that do not support the "vision" or "tool-calling" capabilities, logging warnings when users attempt to use unsupported features. [1] [2]
  • The chat input UI (components/chat/chat-input.tsx and components/chat/attachments-menu.tsx) disables or visually marks unsupported attachments and tool selections, and prevents uploading images if the model lacks vision support. [1] [2] [3] [4] [5] [6] [7] [8]

UI/UX Improvements

  • The model selector UI (components/shared/model-selector.tsx) is improved to group models by provider and includes additional UI components for clarity. [1] [2]
  • In the translation workflow, vision capability detection now uses the new hasCapability helper for accuracy and maintainability. [1] [2] [3]

Testing

  • New tests are added to ensure the correctness of capability gating logic and model metadata (__tests__/lib/chat/capability-gating.test.ts, __tests__/lib/chat/has-capability.test.ts). [1] [2]

These changes collectively ensure that users are guided toward features their selected model supports, reducing errors and improving the overall user experience.

@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-client Ready Ready Preview, Comment May 28, 2026 12:07pm

@mbeps

mbeps commented May 28, 2026

Copy link
Copy Markdown
Owner Author

#89

@mbeps
mbeps merged commit 7654009 into main May 28, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview 4052f823 Deployed May 28, 2026 by vercel[bot]
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.

1 participant