Skip to content

Commit ada8548

Browse files
authored
[vLLM Snippet] Fix escaping (#952)
Follow up to #693 There was trailing space in vlmm snippet which made the snippet unusable. When you try the snippet, vllm server would respond with error: ``` mishig@machine:~$ # Call the server using curl: curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-3.2-3B-Instruct", "messages": [ {"role": "user", "content": "Hello!"} ] }' {"object":"error","message":"[{'type': 'missing', 'loc': ('body',), 'msg': 'Field required', 'input': None}]","type":"BadRequestError","param":null,"code":400}curl: (3) URL using bad/illegal format or missing URL -H: command not found --data: command not found mishig@machine:~$ ``` Explanation: trailing space was breaking the escaping
1 parent 4e7a89a commit ada8548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/tasks/src/local-apps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[]
145145
const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
146146
const runCommand = [
147147
"# Call the server using curl:",
148-
`curl -X POST "http://localhost:8000/v1/chat/completions" \\ `,
149-
` -H "Content-Type: application/json" \\ `,
148+
`curl -X POST "http://localhost:8000/v1/chat/completions" \\`,
149+
` -H "Content-Type: application/json" \\`,
150150
` --data '{`,
151151
` "model": "${model.id}",`,
152152
` "messages": [`,

0 commit comments

Comments
 (0)