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: adding new Playground Manager V2 (chat based) #504

Merged
merged 13 commits into from
Mar 15, 2024

Conversation

axel7083
Copy link
Contributor

@axel7083 axel7083 commented Mar 12, 2024

What does this PR do?

Introducing PlaygroundManagerV2 which use the InferenceManager. This is specifically made for a chat base interaction with the model.

I am deprecating all the PlaygroundManager methods. Should be removed in a near future.

New apis

  • getPlaygroundConversations get the list of conversations available
  • createPlaygroundConversation return a conversation id
  • submitPlaygroundMessage submit a message to a conversation

Screenshot / video of UI

What issues does this PR fix or reference?

Fixes #509

Related to

How to test this PR?

  • unit tests

@axel7083 axel7083 changed the title feat: adding new Playground Manager V2 feat: adding new Playground Manager V2 (chat based) Mar 12, 2024
@axel7083 axel7083 added area/playground kind/feature 💡 Issue for requesting a new feature labels Mar 12, 2024
@axel7083 axel7083 marked this pull request as ready for review March 12, 2024 15:01
@axel7083 axel7083 requested a review from a team as a code owner March 12, 2024 15:01
@axel7083
Copy link
Contributor Author

draft until improvement

@axel7083 axel7083 marked this pull request as draft March 13, 2024 09:34
@axel7083 axel7083 force-pushed the feature/playground-manager-v2 branch from 11b74ab to 455f43c Compare March 13, 2024 09:49
@feloy
Copy link
Contributor

feloy commented Mar 14, 2024

Will this class PlaygroundManagerV2 manage all the playgrounds (as the deprecated class PlayGroundManager is doing with its playgrounds field?

I'll need to get the list of playgrounds, and add new ones in #525, should I rely on this class, or should I use/create another one?

To sum up, it's not clear to me why we are creating this PlaygroundV2Manager and deprecating the PlaygroundManager, if it will cover 100% of it, when, ...?

@jeffmaury
Copy link
Contributor

Will this class PlaygroundManagerV2 manage all the playgrounds (as the deprecated class PlayGroundManager is doing with its playgrounds field?

I'll need to get the list of playgrounds, and add new ones in #525, should I rely on this class, or should I use/create another one?

To sum up, it's not clear to me why we are creating this PlaygroundV2Manager and deprecating the PlaygroundManager, if it will cover 100% of it, when, ...?

We have 2 concept now the inference server and the playgrounds (conversation with a model). So we have a manager for each of them

@axel7083
Copy link
Contributor Author

Will this class PlaygroundManagerV2 manage all the playgrounds (as the deprecated class PlayGroundManager is doing with its playgrounds field?
I'll need to get the list of playgrounds, and add new ones in #525, should I rely on this class, or should I use/create another one?
To sum up, it's not clear to me why we are creating this PlaygroundV2Manager and deprecating the PlaygroundManager, if it will cover 100% of it, when, ...?

We have 2 concept now the inference server and the playgrounds (conversation with a model). So we have a manager for each of them

I will create an epic

@feloy
Copy link
Contributor

feloy commented Mar 14, 2024

To start working on the playgrounds list page (first part of #525), I will need to 'mock' a list of playgrounds. There is one provided by the playground-states store (for now relying on the PlaygroundV1Manager). Can I expect to have something similar with the new architecture (a store with playgrounds information - I'm not worried if the information is different, but will the architecture, based on a store, will be the same)?

@axel7083
Copy link
Contributor Author

To start working on the playgrounds list page (first part of #525), I will need to 'mock' a list of playgrounds. There is one provided by the playground-states store (for now relying on the PlaygroundV1Manager). Can I expect to have something similar with the new architecture (a store with playgrounds information - I'm not worried if the information is different, but will the architecture, based on a store, will be the same)?

This is hard to say yet ! As I mention in https://github.com/projectatomic/ai-studio/issues/535 we have two concept now, Conversation and playground, for now I guess that this Pull Request is outdated, as the PlaygroundManager will not be the one holding the data

@feloy
Copy link
Contributor

feloy commented Mar 14, 2024

I would propose to keep the PlaygroundManager interface as it is (startPlayground / stopPlayground / askPlayground / sendPlaygroundState), or with some minor changes (adding a name at least), and change how these methods are implemented, to make use of the InferenceServer.

It seems to me that changing to using an Inference server should be transparent as much as possible from the frontend point of view.

@axel7083
Copy link
Contributor Author

I would propose to keep the PlaygroundManager interface as it is (startPlayground / stopPlayground / askPlayground / sendPlaygroundState), or with some minor changes (adding a name at least), and change how these methods are implemented, to make use of the InferenceServer.

It seems to me that changing to using an Inference server should be transparent as much as possible from the frontend point of view.

@feloy IMO it does not make really much sense to keep the api startPlayground | stopPlayground as there implementation will not match their naming, as you do not start a playground you start an inference server and the playground will connect to it.

Almost all the code of the current playground manager is about lifecycle of the container, which is now handled by the InferenceManager.

@axel7083 axel7083 force-pushed the feature/playground-manager-v2 branch from 455f43c to 6eda4a1 Compare March 15, 2024 09:40
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>
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>
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>
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 force-pushed the feature/playground-manager-v2 branch from 390fda3 to d1389e0 Compare March 15, 2024 10:59
@axel7083
Copy link
Contributor Author

@feloy following the discussion we had this morning, I added tests !

@axel7083 axel7083 marked this pull request as ready for review March 15, 2024 11:00
Copy link
Contributor

@feloy feloy left a comment

Choose a reason for hiding this comment

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

LGTM
As discussed, the interfaces will change by internalizing some values (model, etc) when we first create a Playground passing a model ID and the playground starts itself the inference server (will be part of #539)

Copy link
Contributor

@feloy feloy left a comment

Choose a reason for hiding this comment

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

thanks!

@feloy feloy merged commit a0bf692 into containers:main Mar 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/playground kind/feature 💡 Issue for requesting a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The PlaygroundManager should be only responsible of the playground requests
3 participants