Skip to content
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

feat: added new models #63

Merged
merged 1 commit into from
Oct 22, 2024
Merged

feat: added new models #63

merged 1 commit into from
Oct 22, 2024

Conversation

xavidop
Copy link
Owner

@xavidop xavidop commented Oct 22, 2024

Before you submit a pull request, please make sure you have read and understood the contribution guidelines and the code of conduct.

This pull request is related to:

  • A bug
  • A new feature
  • Documentation
  • Other (please specify)

I have checked the following:

  • I have read and understood the contribution guidelines and the code of conduct;
  • I have added new tests (for bug fixes/features);
  • I have added/updated the documentation (for bug fixes / features).

Description:
Fix llama models, Phi models and added new llama vision models + new cohere models

Summary by CodeRabbit

  • New Features

    • Introduced new models: metaLlama3211bVisionInstruct, metaLlama3290bVisionInstruct, cohereCommandR082024, cohereCommandRPlus082024, and microsoftPhi35MoE128kInstruct, enhancing multiturn interactions and media capabilities.
    • Updated existing model references for improved clarity and functionality.
  • Bug Fixes

    • Corrected naming and versioning for existing models to ensure consistency.
  • Documentation

    • Updated export statements to include new models for easier access and usage.

Copy link
Contributor

coderabbitai bot commented Oct 22, 2024

Walkthrough

The pull request introduces several new AI model references and updates existing ones in the src/github_llms.ts and src/index.ts files. New models such as metaLlama3211bVisionInstruct, metaLlama3290bVisionInstruct, cohereCommandR082024, and cohereCommandRPlus082024 are added, along with a renamed model microsoftPhi35MiniInstruct and a new model microsoftPhi35MoE128kInstruct. The SUPPORTED_GITHUB_MODELS object is updated accordingly, and the import/export statements in src/index.ts reflect these changes without altering existing logic.

Changes

File Change Summary
src/github_llms.ts - Added models: metaLlama3211bVisionInstruct, metaLlama3290bVisionInstruct, cohereCommandR082024, cohereCommandRPlus082024, microsoftPhi35MoE128kInstruct.
- Renamed model: microsoftPhi35Mini128kInstruct to microsoftPhi35MiniInstruct.
- Updated SUPPORTED_GITHUB_MODELS to include new models and reflect name changes.
src/index.ts - Added imports for new models: metaLlama3211bVisionInstruct, metaLlama3290bVisionInstruct, cohereCommandR082024, cohereCommandRPlus082024, microsoftPhi35MoE128kInstruct.
- Updated export statement to include new models.

Possibly related PRs

  • feat: added support for o1-preview and o1-mini #15: The changes in this PR also modify the src/github_llms.ts and src/index.ts files by adding new model references (openAIO1Preview and openAIO1Mini), which is similar to the addition of new models in the main PR.

Poem

In the meadow, new models bloom,
metaLlama and cohere in the room.
With microsoftPhi now dressed anew,
Our toolkit grows, oh what a view!
Hop along, let’s code and play,
With every change, we leap and sway! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

sonarcloud bot commented Oct 22, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
src/index.ts (1)

51-52: LGTM! Consider maintaining alphabetical order.

The exports are properly grouped by model family (Llama, Cohere, Microsoft) which aids readability. However, consider maintaining alphabetical order within each group for consistency.

  metaLlama318bInstruct,
+ metaLlama3290bVisionInstruct,
  metaLlama3211bVisionInstruct,
- metaLlama3290bVisionInstruct,
  cohereCommandRPlus,
  cohereCommandR,
- cohereCommandR082024,
- cohereCommandRPlus082024,
+ cohereCommandR082024,
+ cohereCommandRPlus082024,

Also applies to: 55-56, 69-69

src/github_llms.ts (3)

Line range hint 240-286: Fix model name and version inconsistencies in Cohere models.

There are configuration issues in the new Cohere models:

  1. cohereCommandRPlus082024 has incorrect name property
  2. Version strings are inconsistent with naming convention

Apply these fixes:

export const cohereCommandR082024 = modelRef({
  name: "github/cohere-command-r",
  info: {
-    versions: ["Cohere-command-r-08-2024"],
+    versions: ["cohere-command-r-08-2024"],
    label: "Cohere - Command-r-08-2024",
    // ...
  }
});

export const cohereCommandRPlus082024 = modelRef({
-  name: "github/cohere-command-r",
+  name: "github/cohere-command-r-plus",
  info: {
-    versions: ["Cohere-command-r-plus-08-2024"],
+    versions: ["cohere-command-r-plus-08-2024"],
    label: "Cohere - Command-r-plus-08-2024",
    // ...
  }
});

Line range hint 465-494: Update label to match new model name convention.

The label for microsoftPhi35Mini128kInstruct still contains "128k" despite the name change in the model identifier and version.

Apply this fix:

export const microsoftPhi35Mini128kInstruct = modelRef({
  name: "github/phi-3.5-mini-instruct",
  info: {
    versions: ["Phi-3.5-mini-instruct"],
-    label: "Microsoft - Phi-3.5-mini-128k-instruct",
+    label: "Microsoft - Phi-3.5-mini-instruct",
    // ...
  }
});

Line range hint 506-524: Update model keys to match version strings.

The keys in SUPPORTED_GITHUB_MODELS should match the version strings defined in the model configurations for consistency.

Apply these fixes:

export const SUPPORTED_GITHUB_MODELS: Record<string, any> = {
  // ...
-  "Llama-3.2-11B-Vision-Instruct": metaLlama3211bVisionInstruct,
-  "Llama-3.2-90B-Vision-Instruct": metaLlama3290bVisionInstruct,
+  "meta-llama-3.2-11b-vision-instruct": metaLlama3211bVisionInstruct,
+  "meta-llama-3.2-90b-vision-instruct": metaLlama3290bVisionInstruct,
  "cohere-command-r": cohereCommandR,
  "cohere-command-r-plus": cohereCommandRPlus,
-  "cohere-command-r-08-2024": cohereCommandR082024,
-  "cohere-command-r-plus-08-2024": cohereCommandRPlus082024,
+  "cohere-command-r-08-2024": cohereCommandR082024,
+  "cohere-command-r-plus-08-2024": cohereCommandRPlus082024,
  // ...
  "Phi-3.5-mini-instruct": microsoftPhi35Mini128kInstruct,
  "Phi-3.5-moe-instruct": microsoftPhi35MoE128kInstruct,
};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 902bc00 and 740f070.

📒 Files selected for processing (2)
  • src/github_llms.ts (7 hunks)
  • src/index.ts (3 hunks)
🧰 Additional context used
🔇 Additional comments (1)
src/index.ts (1)

4-4: LGTM! Verify model definitions exist.

The new model imports align with the PR objectives for adding llama vision and cohere models.

✅ Verification successful

Let me try a different approach to verify the model definitions.

This should help us verify:

  1. The existence of model definitions using a more flexible pattern
  2. The actual content of the github_llms.ts file to ensure it exists and contains the expected exports

All imported models are properly defined and exported

After reviewing the github_llms.ts file, I can confirm that all the imported models are properly defined:

  • microsoftPhi35MoE128kInstruct is defined with proper configuration and exported
  • cohereCommandR082024 and cohereCommandRPlus082024 are defined with proper configurations and exported
  • metaLlama3211bVisionInstruct and metaLlama3290bVisionInstruct are defined with proper configurations and exported, with vision capabilities enabled (media: true)

All models are also correctly registered in the SUPPORTED_GITHUB_MODELS record for use in the system.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that all imported models are properly defined in github_llms.ts
ast-grep --pattern 'export const $MODEL = {
  $$$
}' | rg -A 5 'microsoftPhi35MoE128kInstruct|cohereCommandR082024|cohereCommandRPlus082024|metaLlama3211bVisionInstruct|metaLlama3290bVisionInstruct'

Length of output: 200


Script:

#!/bin/bash
# Search for model definitions using ripgrep directly
rg -U "export const (microsoftPhi35MoE128kInstruct|cohereCommandR082024|cohereCommandRPlus082024|metaLlama3211bVisionInstruct|metaLlama3290bVisionInstruct)\s*=\s*{[^}]*}" --type ts

# Also check if the file exists and show its content
fd "github_llms.ts" --type f --exec cat {}

Length of output: 22500

src/github_llms.ts Show resolved Hide resolved
@xavidop xavidop merged commit 098604e into main Oct 22, 2024
6 of 7 checks passed
@xavidop xavidop deleted the xavier/new-models branch October 22, 2024 23:47
Copy link

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant