Mozilla-Ocho / llamafile

Distribute and run LLMs with a single file.
https://llamafile.ai
Other
20.58k stars 1.04k forks source link

Bug: llamafiler /v1/embeddings endpoint does not return model name #589

Open wirthual opened 1 month ago

wirthual commented 1 month ago

Contact Details

wirthra@gmail.com

What happened?

When running the embedding server:

 ./llamafiler -m ~/Downloads/all-MiniLM-L6-v2.F32.gguf 

And acessing the open ai api endpoint v1/embedding, the model name is not populated

 curl -H 'Content-Type: application/json'       -d '{ "content":"foo"}'       -X POST       localhost:8080/v1/embeddings

This results in an empty model string:

{
  "object": "list",
  "model": "",
  "usage": {
    "prompt_tokens": 3,
    "total_tokens": 3
  },
  "data": [{
  "object": "embedding",
  "index": 0,
  "embedding": [0.032392547, 0.010513297, -0.011017947, 0.06687813, -0.066597596, -0.010583614, 0.18420886, 0.03049396,...]
}]

Can the model name be extracted from the gguf metadata? Or the name provided using the -m option be used?

Version

llamafiler v0.8.13

What operating system are you seeing the problem on?

Linux

Relevant log output

./llamafiler -m ~/Downloads/all-MiniLM-L6-v2.F32.gguf 
2024-12-14T04:17:08.220113 llamafile/server/listen.cpp:33 server listen http://127.0.0.1:8080