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

fix: adding chatformat to use for inference servers #868

Merged
merged 9 commits into from
Apr 15, 2024

Conversation

axel7083
Copy link
Contributor

What does this PR do?

This PR is adding the optional chatformat to the model object.

Need containers/podman-desktop-extension-ai-lab-playground-images#11 to be merged, and a new version published of the image to be working.

Fixing the playgrounds for the following models

  • Merlinite
  • Cerebrum
  • dragon-mistral

Screenshot / video of UI

image

image

What issues does this PR fix or reference?

Fixes #825

How to test this PR?

  • unit tests has been provided

@jeffmaury
Copy link
Contributor

As a general comment I think this is too specific for chat models. We already have the plan to add a type attribute to models (chat, vision,...) so I think it would be better to rename the field to something more general purpose (format ?). And the env variable should be renamed accordingly

@jeffmaury
Copy link
Contributor

Was thinking intensively about this during the night: found a more generic way to handle that.
Basically we want to pass model attributes to the containers so let's add an attributes field to the model catalog and this will be a record of values. When launching the container, pass each value of this record as a env variable named MODEL_key where key is the uppercase transcription eg if the key is chatformat then the env var would be MODEL_CHATFORMAT.
This would requires a small change on the recipes but allows for better evolution in the future if new attributes are added.
WDYT ?

@benoitf
Copy link
Collaborator

benoitf commented Apr 11, 2024

freeform is more extensible 👍

about keys is it using camelCase ?

chatFormat -> CHAT_FORMAT ?

@axel7083
Copy link
Contributor Author

MODEL_

I like this solution but I am not sure about the necessity of the MODEL_ prefix ?

@benoitf
Copy link
Collaborator

benoitf commented Apr 11, 2024

"properties" : {
  "chatFormat": "openchat"
}

?

@jeffmaury
Copy link
Contributor

MODEL_

I like this solution but I am not sure about the necessity of the MODEL_ prefix ?

The MODEL_ prefix just to standardize on what is provider by AI Lab as we already provider MODEL_PATH and as it's related to the model

@jeffmaury
Copy link
Contributor

MODEL_

I like this solution but I am not sure about the necessity of the MODEL_ prefix ?

The MODEL_ prefix just to standardize on what is provided by AI Lab as we already provide MODEL_PATH and as it's related to the model

@axel7083
Copy link
Contributor Author

"properties" : {
  "chatFormat": "openchat"
}

?

We are using the labels wording in several places, might want to stick with that ?

@jeffmaury
Copy link
Contributor

"properties" : {
  "chatFormat": "openchat"
}

?

We are using the labels wording in several places, might want to stick with that ?

labels are intended for display I think this is more internal here so I would be more for attributes or properties

@axel7083
Copy link
Contributor Author

labels are intended for display I think this is more internal here so I would be more for attributes or properties
Go for properties then !

The prefix would not work with containers/podman-desktop-extension-ai-lab-playground-images#11 for now, might want to not having it for now ?

@axel7083
Copy link
Contributor Author

"properties" : {
  "chatFormat": "openchat"
}

chat_format is easier to transform to CHAT_FORMAT than chatFormat, we jsut have to use uppercase() for the first one

@benoitf
Copy link
Collaborator

benoitf commented Apr 11, 2024

I think that I expect camelCase in a json file also about easier I'm not sure it would be much harder anyway

'chatFormat'.replace(/[A-Z]/g, m => `_${m}`).toUpperCase() => CHAT_FORMAT

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 force-pushed the fix/setting-chatformat-for-models branch from e40569b to bbeeda3 Compare April 11, 2024 08:21
@axel7083
Copy link
Contributor Author

I think that I expect camelCase in a json file also about easier I'm not sure it would be much harder anyway

No problem then

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 requested review from jeffmaury and benoitf April 11, 2024 08:23
@jeffmaury
Copy link
Contributor

labels are intended for display I think this is more internal here so I would be more for attributes or properties
Go for properties then !

The prefix would not work with containers/podman-desktop-extension-ai-lab-playground-images#11 for now, might want to not having it for now ?

I would favor (and not delay) the prefix is the ai-recipes team is ok with this change, starting the discussion on their channel

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083
Copy link
Contributor Author

labels are intended for display I think this is more internal here so I would be more for attributes or properties
Go for properties then !

The prefix would not work with containers/podman-desktop-extension-ai-lab-playground-images#11 for now, might want to not having it for now ?

I would favor (and not delay) the prefix is the ai-recipes team is ok with this change, starting the discussion on their channel

✅ done

@benoitf
Copy link
Collaborator

benoitf commented Apr 11, 2024

so here we need to update https://github.com/containers/podman-desktop-extension-ai-lab-playground-images/pull/11/files to use MODEL_ env var

Copy link
Contributor

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

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

LGTM. Recipe repo has been updated so we should be good

@benoitf
Copy link
Collaborator

benoitf commented Apr 12, 2024

before merging,

'ghcr.io/containers/podman-desktop-extension-ai-lab-playground-images/ai-lab-playground-chat:0.2.0';
need to be updated and a new release should happen in the https://github.com/containers/podman-desktop-extension-ai-lab-playground-images repo

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 marked this pull request as ready for review April 12, 2024 08:56
@axel7083 axel7083 requested a review from a team as a code owner April 12, 2024 08:56
@axel7083 axel7083 requested review from benoitf and feloy April 12, 2024 08:56
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Copy link
Contributor

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

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

LGTM

@axel7083 axel7083 merged commit 885fce5 into containers:main Apr 15, 2024
4 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.

Merlinite model needs "chat_format" set to "openchat"
3 participants