Hi, I'm trying to start an LLM instance that uses ...
# questions
w
Hi, I'm trying to start an LLM instance that uses a local vllm server using the instructions I found - prepending openai/ before model name, adding /v1 at the end of the base url, and some string as the API key (no key in the vllm) and it's not working- saying that there's a litellm authentication error for incorrect key no matter what I put. Help please?
w
what did you set for base_url and model_name
w
"http://llm-demo4:8007/v1" "openai/Qwen/Qwen2.5-14B-Instruct-GPTQ-Int4"
I tried removing the openai/ prefix and that didn't work, tried hosted_vllm/ also, no dice
c
Could you try without the “Qwen/“ in the middle, so just prefix openai/ and model name?
w
I'll try- also i did curl directly to the server to see that it accepts my 'empty' key and it worked
Nope, didn't work- the Qwen/ is part of the model name when getting the model list from the VLLM
Copy code
{
  "object": "list",
  "data": [
    {
      "id": "Qwen/Qwen2.5-14B-Instruct-GPTQ-Int4",
      "object": "model",
      "created": 1762275568,
      "owned_by": "vllm",
      "root": "Qwen/Qwen2.5-14B-Instruct-GPTQ-Int4",
      "parent": null,
      "max_model_len": 9600,
      "permission": [
        {
          "id": "modelperm-e78e8e37b0004004b30e66523c18ad31",
          "object": "model_permission",
          "created": 1762275568,
          "allow_create_engine": false,
          "allow_sampling": true,
          "allow_logprobs": true,
          "allow_search_indices": false,
          "allow_view": true,
          "allow_fine_tuning": false,
          "organization": "*",
          "group": null,
          "is_blocking": false
        }
      ]
    }
  ]
}
c
Aha, that seems right then 🤔
w
the server accepts any key, it makes me think it's a litellm problem
Copy code
⏺ Bash(curl -X POST 'http://llm-demo4:8007/v1/chat/completions' -H 'Content-Type: application/json' -H 'Authorization: Bearer 12341234' -d '{"model": "Qwen/Qwen2.5-14B-Instruct-GPTQ-Int4", "messages": [{"role": "user",          timeout:
      "content": "Say hello"}], "max_tokens": 10}' 2>&1)                                                                                                                                                                            30s
  ⎿   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
100   731  100   609  100   122    473     94  0:00:01  0:00:01 --:--:--     0
     568
    {
      "id": "chatcmpl-e853cb542db341b0b7b4947e586eb531",
      "object": "chat.completion",
      "created": 1762278063,
      "model": "Qwen/Qwen2.5-14B-Instruct-GPTQ-Int4",
      "choices": [
        {......
but i'm totally new at this, hoping you guys would know
c
I see in litellm docs that base url doesn’t have “/v1”
w
i'm wrapping the llm object with some other stuff, i'll try to use it cleanly for a minute, maybe i'm messing it up down the line
c
Just a thought, have you seen our doc with vllm? It recommends vllm serve with an api key, and then use that? https://docs.openhands.dev/openhands/usage/llms/local-llms#serving-the-model-using-vllm
w
ok that test worked! i must be messing something up later
👍 1
just like you recommend with the openai/ and the v1 it worked
aha 1
thanks!!
c
Most welcome, sorry it’s a bit weird lolsob