sim icon indicating copy to clipboard operation
sim copied to clipboard

[BUG] API key is required for vllm

Open BriceMichalskiOneup opened this issue 2 months ago • 1 comments

Describe the bug When using sim with VLLM_BASE_URL, sim can see and list all the model hosted behind but throw an API key is required for vllm vllm/qwen-3 error message on use. whether the VLLM_API_KEY variable is set or not.

vLLM is reachable on all other side app, without any api key.

To Reproduce Steps to reproduce the behavior:

  1. Start an vLLM instance
  2. Deploy Sim using helm-chart (based on this values for me )
  3. Setup VLLM_BASE_URL under app.env key
app:
  env: 
    ...
    VLLM_BASE_URL: "https:/vllm.exemple.com"
    ...
  1. Open an agent in editor and select our vLLM model
  2. Click on 'Run' to test connectivity

Expected behavior Can use vLLM hosted model

Screenshots

Image Image

Additional context

Chart version: v0.5.29 App version: v0.5.29

Full log on app side:

[2025-12-15T13:33:40.083Z] [ERROR] [AgentBlockHandler] Failed to get API key: {"provider":"vllm","model":"vllm/qwen-3","error":"API key is required for vllm vllm/qwen-3","hasProvidedApiKey":false}
[2025-12-15T13:33:40.083Z] [ERROR] [BlockExecutor] Block execution failed {"blockId":"f83f3c4e-b453-476a-b963-9f21db2211e9","blockType":"agent","error":"API key is required for vllm vllm/qwen-3"}
[2025-12-15T13:33:40.084Z] [ERROR] [ExecutionEngine] Node execution failed {"nodeId":"f83f3c4e-b453-476a-b963-9f21db2211e9","error":"[agent] Agent 1: API key is required for vllm vllm/qwen-3"}
[2025-12-15T13:33:40.084Z] [ERROR] [ExecutionEngine] Execution failed {"error":"[agent] Agent 1: API key is required for vllm vllm/qwen-3"}
[2025-12-15T13:33:40.084Z] [ERROR] [ExecutionCore] [bb20a523] Execution failed: {"message":"[agent] Agent 1: API key is required for vllm vllm/qwen-3","blockId":"f83f3c4e-b453-476a-b963-9f21db2211e9","blockName":"Agent 1","blockType":"agent","workflowId":"46640e50-ee47-4e34-a432-2062e44949c7","timestamp":"2025-12-15T13:33:40.084Z","nodeId":"f83f3c4e-b453-476a-b963-9f21db2211e9","executionTime":0,"executionResult":{"success":false,"output":{},"error":"[agent] Agent 1: API key is required for vllm vllm/qwen-3","logs":[{"blockId":"ed396b24-8488-4c2c-b8d1-2fcecaa3b065","blockName":"Start","blockType":"start_trigger","startedAt":"2025-12-15T13:33:40.082Z","endedAt":"2025-12-15T13:33:40.082Z","durationMs":0,"success":true,"input":{"inputFormat":[{"id":"43256295-8ba7-431b-a1bc-d422916a0dd9","name":"username","type":"string","value":"foo","collapsed":false}],"triggerMode":true},"output":{"username":"foo"}},{"blockId":"f83f3c4e-b453-476a-b963-9f21db2211e9","blockName":"Agent 1","blockType":"agent","startedAt":"2025-12-15T13:33:40.083Z","endedAt":"2025-12-15T13:33:40.083Z","durationMs":0,"success":false,"input":{"model":"vllm/qwen-3","tools":[],"apiKey":null,"messages":[{"role":"user","content":"Say hello to foo."}],"verbosity":"medium","memoryType":"none","temperature":0.3,"azureEndpoint":null,"conversationId":"session-foo","responseFormat":null,"azureApiVersion":null,"reasoningEffort":"medium","slidingWindowSize":null,"slidingWindowTokens":null},"error":"API key is required for vllm vllm/qwen-3"}],"metadata":{"requestId":"bb20a523","executionId":"444cb113-7b72-474f-8602-d301e227c1a3","workflowId":"46640e50-ee47-4e34-a432-2062e44949c7","workspaceId":"74296bf1-9476-488a-9771-ebe4ab1c24ab","userId":"hugvHtQNLfMfYOL6unmxRRBj90QFBAUP","sessionUserId":"hugvHtQNLfMfYOL6unmxRRBj90QFBAUP","workflowUserId":"hugvHtQNLfMfYOL6unmxRRBj90QFBAUP","triggerType":"manual","useDraftState":true,"startTime":"2025-12-15T13:33:40.082Z","isClientSession":true,"workflowStateOverride":{"blocks":{"ed396b24-8488-4c2c-b8d1-2fcecaa3b065":{"id":"ed396b24-8488-4c2c-b8d1-2fcecaa3b065","type":"start_trigger","name":"Start","position":{"x":-797.6923076923077,"y":-672.3076923076922},"enabled":true,"horizontalHandles":true,"advancedMode":false,"triggerMode":false,"height":0,"subBlocks":{"inputFormat":{"id":"inputFormat","type":"input-format","value":[{"id":"43256295-8ba7-431b-a1bc-d422916a0dd9","name":"username","type":"string","value":"Brice","collapsed":false}]}},"outputs":{"files":{"type":"files","description":"User uploaded files"},"input":{"type":"string","description":"Primary user input or message"},"conversationId":{"type":"string","description":"Conversation thread identifier"}},"data":{}},"f83f3c4e-b453-476a-b963-9f21db2211e9":{"id":"f83f3c4e-b453-476a-b963-9f21db2211e9","type":"agent","name":"Agent 1","position":{"x":-498.84615384615375,"y":-756.153846153846},"enabled":true,"horizontalHandles":true,"advancedMode":false,"triggerMode":false,"height":0,"subBlocks":{"model":{"id":"model","type":"combobox","value":"vllm/qwen-3"},"tools":{"id":"tools","type":"tool-input","value":[]},"apiKey":{"id":"apiKey","type":"short-input","value":null},"messages":{"id":"messages","type":"messages-input","value":[{"role":"user","content":"Say hello to <start.username>."}]},"verbosity":{"id":"verbosity","type":"dropdown","value":"medium"},"memoryType":{"id":"memoryType","type":"dropdown","value":"none"},"temperature":{"id":"temperature","type":"slider","value":0.3},"azureEndpoint":{"id":"azureEndpoint","type":"short-input","value":null},"conversationId":{"id":"conversationId","type":"short-input","value":"session-foo"},"responseFormat":{"id":"responseFormat","type":"code","value":null},"azureApiVersion":{"id":"azureApiVersion","type":"short-input","value":null},"reasoningEffort":{"id":"reasoningEffort","type":"dropdown","value":"medium"},"slidingWindowSize":{"id":"slidingWindowSize","type":"short-input","value":null},"slidingWindowTokens":{"id":"slidingWindowTokens","type":"short-input","value":null}},"outputs":{"model":{"type":"string","description":"Model used for generation"},"tokens":{"type":"any","description":"Token usage statistics"},"content":{"type":"string","description":"Generated response content"},"toolCalls":{"type":"any","description":"Tool calls made"}},"data":{}}},"edges":[{"id":"9b4ef229-fbe9-4bb9-be1c-93756d220f22","source":"ed396b24-8488-4c2c-b8d1-2fcecaa3b065","target":"f83f3c4e-b453-476a-b963-9f21db2211e9","sourceHandle":"source","targetHandle":"target","type":"default","data":{}}],"loops":{},"parallels":{}},"duration":2,"endTime":"2025-12-15T13:33:40.084Z"}}}
Error: [agent] Agent 1: API key is required for vllm vllm/qwen-3
    at $ (.next/server/chunks/apps_sim_lib_workflows_executor_human-in-the-loop-manager_ts_98617cee._.js:1:15802)
    at handleBlockError (.next/server/chunks/apps_sim_lib_workflows_executor_human-in-the-loop-manager_ts_98617cee._.js:1:18370)
    at processTicksAndRejections (null) {
  blockId: 'f83f3c4e-b453-476a-b963-9f21db2211e9',
  blockName: 'Agent 1',
  blockType: 'agent',
  workflowId: '46640e50-ee47-4e34-a432-2062e44949c7',
  timestamp: '2025-12-15T13:33:40.084Z',
  nodeId: 'f83f3c4e-b453-476a-b963-9f21db2211e9',
  executionTime: 0,
  executionResult: [Object]
}
 ⨯ unhandledRejection:  Error: [agent] Agent 1: API key is required for vllm vllm/qwen-3
    at $ (.next/server/chunks/apps_sim_lib_workflows_executor_human-in-the-loop-manager_ts_98617cee._.js:1:15802)
    at handleBlockError (.next/server/chunks/apps_sim_lib_workflows_executor_human-in-the-loop-manager_ts_98617cee._.js:1:18370)
    at processTicksAndRejections (null) {
  blockId: 'f83f3c4e-b453-476a-b963-9f21db2211e9',
  blockName: 'Agent 1',
  blockType: 'agent',
  workflowId: '46640e50-ee47-4e34-a432-2062e44949c7',
  timestamp: '2025-12-15T13:33:40.084Z',
  nodeId: 'f83f3c4e-b453-476a-b963-9f21db2211e9',
  executionTime: 0,
  executionResult: [Object]
}

BriceMichalskiOneup avatar Dec 15 '25 13:12 BriceMichalskiOneup

I checked the code and found that SimStudioConfig requires 'apikey' unconditionally, which causes issues for self-hosted backends like vLLM where an API key is not required. Proposed approach:

  • Make 'apikey' optional in SimStudioConfig
  • Only send X-API-key header when 'apikey' is provided

Please let me know if this approach is acceptable. I can open a PR once confirmed

Niha241 avatar Dec 17 '25 09:12 Niha241

@BriceMichalskiOneup is resolved in latest image, reopen if there are any issues

waleedlatif1 avatar Dec 17 '25 18:12 waleedlatif1