mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat: add endpoint to list system informations (#3449)
* feat: add endpoint to list system informations For now, it lists the available backends, but can be expanded later on to include more system informations (such as GPU devices detected, RAM, threads configured, and so on so forth). Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * show also external backends Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * add test Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
ac5d655598
commit
791c3ace72
5 changed files with 50 additions and 0 deletions
|
@ -772,6 +772,17 @@ var _ = Describe("API test", func() {
|
|||
Expect(err.Error()).To(ContainSubstring("error, status code: 500, message: could not load model - all backends returned error:"))
|
||||
})
|
||||
|
||||
It("shows the external backend", func() {
|
||||
// do an http request to the /system endpoint
|
||||
resp, err := http.Get("http://127.0.0.1:9090/system")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(resp.StatusCode).To(Equal(200))
|
||||
dat, err := io.ReadAll(resp.Body)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(string(dat)).To(ContainSubstring("huggingface"))
|
||||
Expect(string(dat)).To(ContainSubstring("llama-cpp"))
|
||||
})
|
||||
|
||||
It("transcribes audio", func() {
|
||||
if runtime.GOOS != "linux" {
|
||||
Skip("test supported only on linux")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue