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:Updated Deep Infra models #121

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Dec 9, 2024

Created by Github Actions

Summary by CodeRabbit

  • New Features
    • Introduced two new models: Llama3370BInstruct and Llama3370BInstructTurbo.
    • Updated pricing for several existing models, reflecting reduced costs.
  • Bug Fixes
    • Removed outdated model DeepseekV25 from the available models list.
  • Chores
    • Updated model metadata in the provider to reflect new models and adjusted pricing.

Copy link
Contributor

coderabbitai bot commented Dec 9, 2024

Walkthrough

The changes in this pull request involve the addition of new enumerations and updates to existing entries within the DeepInfraModelIds enum, specifically introducing Llama3370BInstruct and Llama3370BInstructTurbo. Alongside these additions, several existing model entries have had their prompt and completion costs adjusted downward. Additionally, the DeepseekV25 entry has been removed. Corresponding updates were made to the DeepInfraModelProvider class to reflect these changes in the models dictionary, and two new model classes were introduced while removing the obsolete DeepseekV25Model.

Changes

File Path Change Summary
src/DeepInfra/src/DeepInfraModelIds.cs - Added: Llama3370BInstruct, Llama3370BInstructTurbo enumerations with descriptions.
- Updated: Prompt and completion costs for several existing models.
- Removed: DeepseekV25 entry.
src/DeepInfra/src/DeepInfraModelProvider.cs - Updated: Models dictionary with new entries for Llama3370BInstruct and Llama3370BInstructTurbo.
- Retained and updated metadata for some existing models.
- Removed several obsolete model entries.
src/DeepInfra/src/Predefined/AllModels.cs - Added: Llama3370BInstructModel, Llama3370BInstructTurboModel classes.
- Removed: DeepseekV25Model class.

Possibly related PRs

  • feat:Updated Deep Infra models #79: This PR adds new enumeration values to DeepInfraModelIds, which is related to the changes in the main PR that also introduces new enumerations in the same enum.
  • feat:Updated Deep Infra models #112: This PR introduces new enumerations to DeepInfraModelIds, which is relevant as the main PR also modifies this enum by adding new entries.
  • feat:Updated Deep Infra models #116: This PR adds a new entry to DeepInfraModelIds, which is related to the main PR's changes that also involve modifications to this enum.

Suggested reviewers

  • github-actions

Poem

🐰 In the fields of code we play,
New models hop in, bright as day.
Costs are lowered, changes made,
Old models fade, new ones parade.
With each line, our dreams take flight,
In the world of AI, all feels right! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4f28bf6 and 26577c8.

📒 Files selected for processing (3)
  • src/DeepInfra/src/DeepInfraModelIds.cs (18 hunks)
  • src/DeepInfra/src/DeepInfraModelProvider.cs (3 hunks)
  • src/DeepInfra/src/Predefined/AllModels.cs (1 hunks)
🔇 Additional comments (5)
src/DeepInfra/src/DeepInfraModelProvider.cs (2)

12-13: LGTM: New Llama-3.3-70B-Instruct model added correctly.

The model is properly configured with:

  • Context length: 131072
  • Prompt cost: $0.23/MTok
  • Completion cost: $0.4/MTok

14-16: Verify cost consistency for Meta Llama models.

Several Meta Llama models have different completion costs despite being similar in architecture:

  • Llama3370BInstruct: completion=$0.4/MTok
  • MetaLlama3170BInstruct: completion=$0.23/MTok

Run the following script to check cost patterns across Meta Llama models:

✅ Verification successful

Cost variations in Meta Llama models are consistent with model sizes and capabilities

The cost differences between Meta Llama models in DeepInfra are justified:

  • Larger models have higher costs:

    • 405B model: $0.9/MTok for both input and output
    • 70B models: $0.23-0.40/MTok input, $0.40/MTok output
    • 8B models: $0.02-0.03/MTok input, $0.05-0.06/MTok output
  • Turbo variants have lower input costs but same output costs:

    • 70B Turbo: $0.13/MTok input vs Regular: $0.23/MTok input
    • 8B Turbo: $0.02/MTok input vs Regular: $0.03/MTok input

The pricing structure logically scales with model size and optimization level.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check cost patterns across Meta Llama models
rg "Llama.*Instruct.*Completion Cost:" -A 1

Length of output: 45


Script:

#!/bin/bash
# Let's search for model costs in the codebase using a more general pattern
rg "ToMetadata.*meta-llama.*Instruct" -A 1

Length of output: 6263


Script:

#!/bin/bash
# Let's also check the model IDs and their definitions
ast-grep --pattern 'public static class DeepInfraModelIds { $$$ }'

Length of output: 68


Script:

#!/bin/bash
# Search for any cost-related documentation or comments
rg -i "cost|pricing|token" --type cs

Length of output: 66606


Script:

#!/bin/bash
# Let's search for Meta Llama model costs in DeepInfra provider
rg "Meta.*Llama.*Instruct.*ToMetadata" src/DeepInfra/src/DeepInfraModelProvider.cs

Length of output: 1126


Script:

#!/bin/bash
# Let's also check if there are any comments or documentation about pricing in the DeepInfra provider
rg -i "cost|price|token" src/DeepInfra/src/DeepInfraModelProvider.cs

Length of output: 344

src/DeepInfra/src/Predefined/AllModels.cs (1)

3-11: LGTM: New model classes properly implemented.

The new Llama3370BInstructModel and Llama3370BInstructTurboModel classes:

  • Follow the established pattern
  • Have proper XML documentation
  • Correctly inherit from DeepInfraModel
src/DeepInfra/src/DeepInfraModelIds.cs (2)

9-29: LGTM: New model enums well documented.

The new Llama3370BInstruct and Llama3370BInstructTurbo enums have comprehensive documentation including:

  • Model name and organization
  • Context length and costs
  • Detailed description
  • HuggingFace URL

607-608: Verify cost reductions for Mistral models.

Significant cost reductions noted for Mistral models:

  • Mistral7BInstructV03: $0.03/MTok (reduced)
  • MistralNemoInstruct2407: $0.04/MTok (reduced)

Please confirm these are intentional price changes.

Run the following script to check historical cost changes:

Also applies to: 618-619

✅ Verification successful

Cost verification for Mistral models confirmed

The costs in the code match exactly with what was mentioned in the review comment:

  • Mistral7BInstructV03: $0.03/MTok for both prompt and completion
  • MistralNemoInstruct2407: $0.04/MTok for both prompt and completion
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check cost history for Mistral models
git log -p -- "src/DeepInfra/src/DeepInfraModelIds.cs" | rg "Mistral.*Cost:"

Length of output: 0


Script:

#!/bin/bash
# Let's try a different approach to check the current costs for Mistral models
rg -A 1 "Mistral.*Instruct.*{" src/DeepInfra/src/DeepInfraModelIds.cs

Length of output: 175


Script:

#!/bin/bash
# Also check the costs directly
rg "Cost.*MTok" src/DeepInfra/src/DeepInfraModelIds.cs

Length of output: 5072


Script:

#!/bin/bash
# Let's also check if there are any other cost-related comments for these models
rg "Mistral" src/DeepInfra/src/DeepInfraModelIds.cs

Length of output: 2878


Script:

#!/bin/bash
# Let's get more context around the Mistral models to see their costs
rg -B 2 -A 4 "Mistral7BInstructV03|MistralNemoInstruct2407" src/DeepInfra/src/DeepInfraModelIds.cs

Length of output: 721


Script:

#!/bin/bash
# Let's try to find the cost information near these model definitions
rg -B 5 -A 5 "Mistral7BInstructV03" src/DeepInfra/src/DeepInfraModelIds.cs

Length of output: 686


Script:

#!/bin/bash
# And for the other model
rg -B 5 -A 5 "MistralNemoInstruct2407" src/DeepInfra/src/DeepInfraModelIds.cs

Length of output: 658


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.

@github-actions github-actions bot enabled auto-merge December 9, 2024 06:51
@github-actions github-actions bot merged commit c4165af into main Dec 9, 2024
3 checks passed
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