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

Inference to use provider resource id to register and validate #428

Merged
merged 13 commits into from
Nov 13, 2024

Conversation

dineshyv
Copy link
Contributor

@dineshyv dineshyv commented Nov 12, 2024

This PR changes the way model id gets translated to the final model name that gets passed through the provider.
Major changes include:

  1. Providers are responsible for registering an object and as part of the registration returning the object with the correct provider specific name of the model provider_resource_id
  2. To help with the common look ups different names a new ModelLookup class is created.

Tested all inference providers including together, fireworks, vllm, ollama, meta reference and bedrock

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 12, 2024
Copy link
Contributor

@raghotham raghotham left a comment

Choose a reason for hiding this comment

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

can you make sure to change the zero-to-hero notebooks as well?

@dineshyv dineshyv force-pushed the dineshyv/stackid-to-providerid branch from 0f7fcfd to 948f6ec Compare November 12, 2024 22:30
@@ -237,7 +237,7 @@ async def completion(
@webmethod(route="/inference/chat_completion")
async def chat_completion(
self,
model: str,
model_id: str,
Copy link
Contributor

@yanxi0830 yanxi0830 Nov 13, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Contributor

Choose a reason for hiding this comment

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

llama-stack-apps and llama-stack-client-python also needs to be updated to reflect the model -> model_id change.

https://github.com/meta-llama/llama-stack-apps/blob/0dc9c42fb42bf21d35e6d231afc4e0360a9eac61/examples/inference/client.py#L46-L49

@ashwinb
Copy link
Contributor

ashwinb commented Nov 13, 2024

very useful change!

@dineshyv dineshyv merged commit fdff24e into main Nov 13, 2024
2 checks passed
@dineshyv dineshyv deleted the dineshyv/stackid-to-providerid branch November 13, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants