Skip to content

Check input model and return if the model does not exist in modelPath #2314

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 10 commits into from
Closed

Check input model and return if the model does not exist in modelPath #2314

wants to merge 10 commits into from

Conversation

joseluisll
Copy link

Description

This PR addresses the issue #1076 . This PR checks if the model specified in the request exists in the model Path. If it doesn´t exist, then the request returns an error, the same way that it is done for the model specified in the bearer token context when the model doesn´t exist.

I chose to modify the fiber.go in the http context as it is common for all endpoints.

I have not introduce any change in backend to model mapping, or backend behaviour, and simply adds a check reusing and existing function.

Notes for Reviewers

Signed commits

  • [ X ] Yes, I signed my commits.

Copy link

netlify bot commented May 13, 2024

Deploy Preview for localai canceled.

Name Link
🔨 Latest commit fe15986
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/66427f90aa6633000875fbc2

joseluisll and others added 8 commits May 13, 2024 22:56
… specified but it doen´t exist in modelPath

Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
* auto select cpu variant

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

* remove cuda target for now

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

* fix metal

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

* fix path

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

---------

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
feat(llama.cpp): add flash_attn and no_kv_offload

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
Modified the message to report that the specified model doesn´t exist in the model Path.

Signed-off-by: Jose Luis López López <joseluisll@gmail.com>
@joseluisll joseluisll marked this pull request as draft May 14, 2024 05:28
@joseluisll
Copy link
Author

Models are asynchronously loaded, and I don´t see a direct access to the configuration structures that define the models and the backends from the http fiber App.

This PR will be closed and i need to think on a more elaborated solution.

¿May be inject a service into the App fiber from the go APP in orden to get the list of model names, model file names and check if they are loaded or not?

@joseluisll joseluisll closed this May 14, 2024
@joseluisll joseluisll deleted the 1076-CheckInputModel branch May 14, 2024 09:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants