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: use model name as adapter id in chat endpoints #2128

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

drbh
Copy link
Collaborator

@drbh drbh commented Jun 26, 2024

This PR allows users to specify lora adapter ids as the model value in the /v1/chat/completions and /v1/completions endpoints.

This feature aligns with other lora implementations and was mentioned here during the initial lora PR #2010 (comment)

curl localhost:3000/v1/chat/completions -s \
    -H 'Content-Type: application/json'  \
    -X POST \
    -d '{
  "model": "predibase/customer_support",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "What is deep learning?"
    }
  ],
  "stream": false,
  "max_tokens": 20, "seed": 42
}' | jq .

@@ -673,7 +674,7 @@ async fn completions(
seed,
top_n_tokens: None,
grammar: None,
..Default::default()
adapter_id: model.as_ref().filter(|m| *m != "tgi").map(String::from),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove this special value ? It should exist in the first place.

if openai requires a model id, then we should actually match it against the actual deployed model id, no ?

Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

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

Merging.

"tgi" is used throughout our docs. Just for backward compat we should support it somehow.

Definitely not great though.

@Narsil Narsil merged commit 87ebb64 into main Jul 8, 2024
9 checks passed
@Narsil Narsil deleted the enable-adapter-id-in-chat branch July 8, 2024 14:06
yuanwu2017 pushed a commit to yuanwu2017/tgi-gaudi that referenced this pull request Sep 26, 2024
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.

2 participants