containers / podman-desktop-extension-ai-lab

Work with LLMs on a local environment using containers
https://podman-desktop.io/extensions/ai-lab
Apache License 2.0
182 stars 39 forks source link

`ModelUtils.ts` should not contain process execution logic #1809

Open axel7083 opened 1 month ago

axel7083 commented 1 month ago

Is your enhancement related to a problem? Please describe

Currently the packages/backend/src/utils/modelsUtils.ts has two method which should not be in an utility file

https://github.com/containers/podman-desktop-extension-ai-lab/blob/e2d5a2e6b5839337575fbd622ef271ca1d46be1b/packages/backend/src/utils/modelsUtils.ts#L50

https://github.com/containers/podman-desktop-extension-ai-lab/blob/e2d5a2e6b5839337575fbd622ef271ca1d46be1b/packages/backend/src/utils/modelsUtils.ts#L66

Those two method uses the process api exposed by the podman-desktop core. They are getting the podman executable through getPodmanCli which should be deprecated since https://github.com/containers/podman-desktop/pull/8891 has been merged

Describe the solution you'd like

We need to support the new https://github.com/containers/podman-desktop/pull/8891 and properly manage the legacy support (version < 1.13).

The logic method should be moved to the PodmanConnection class.

Describe alternatives you've considered

No response

Additional context

This work is required for https://github.com/containers/podman-desktop-extension-ai-lab/issues/1591