-
Notifications
You must be signed in to change notification settings - Fork 2
Language models overhaul #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Updated model parsing logic to support new capabilities and system configurations. - Introduced filtering for models based on provider constraints and capabilities. - Enhanced model resolution process to include provider metadata and improved error handling. - Removed deprecated model selector functionality and streamlined model exports. - Added support for new model providers and updated existing model definitions with accurate pricing and capabilities. - Improved overall code structure for better maintainability and readability.
- Updated `tsconfig.json` to disable incremental builds for better performance. - Refactored model exports to ensure type safety by using `unknown` casting. - Introduced a temporary regex pattern for model matching in `index.ts`. - Modified model type definitions to allow optional `hfSlug` values. - Removed deprecated demo and old model files to streamline the codebase. - Improved model parsing and resolution logic for better compatibility and error handling.
…nguage model package - Deleted the index.ts file to eliminate stub implementation and fix build errors. - Renamed package from "ai-models" to "language-models" in package.json. - Updated tsconfig.json to ensure proper TypeScript compilation settings.
- Removed the ai-models package and replaced its usage with language-models across the codebase. - Introduced a new function `getModels` for improved model parsing and resolution. - Updated package.json files to reflect the new dependencies and removed unnecessary workspace links. - Enhanced the API integration in the llm.do worker endpoints to utilize the new language-models package.
- Updated the `getModel` function to accept an `augments` parameter for additional model configurations. - Improved handling of model identifiers by injecting augmentations into the model string. - Refactored the `ArenaCompletion` class to ensure type safety in model resolution and completion requests. - Changed the type of `requiredCapabilities` to a string array for better clarity in capability management.
- Changed the type of the accumulator in the `reduce` function from a specific Record type to `any` for flexibility in handling completion models. - This adjustment aims to enhance the overall type safety and maintainability of the `ArenaCompletion` class.
Overhauled the all models type, which was causing the TSServer to crash when loading it into memory. This new type is now 99% shorter.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…andling - Changed the API route handling to use '/api' instead
…low it to be stored in git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 23 out of 28 changed files in this pull request and generated 4 comments.
Files not reviewed (5)
- package.json: Language not supported
- pkgs/language-models/.editorconfig: Language not supported
- pkgs/language-models/.gitattributes: Language not supported
- pkgs/language-models/.gitignore: Language not supported
- pkgs/language-models/package.json: Language not supported
Comments suppressed due to low confidence (1)
app/(apis)/models/route.ts:135
- The use of '@ts-expect-error' here suppresses a type error in the sorting logic; please consider explicitly casting or handling the type to avoid suppressing potentially important errors.
// @ts-expect-error - Ignore
@@ -78,6 +86,53 @@ async function main() { | |||
return mergedModel | |||
}) | |||
|
|||
const finalModels = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'finalModels' is declared but never used; consider removing it to clean up the code.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -124,6 +129,10 @@ export const GET = API(async (request, { db, user, origin, url, domain, params } | |||
} | |||
} | |||
|
|||
console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A debug console.log statement is present; remove it or replace it with proper logging before merging to production.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model regex should be updated to reflect the format, but I can see how that will be a TODO considering the open questions.
… into language-models-overhaul
No description provided.