ryoppippi / curxy

Simple proxy worker for using ollama in cursor
https://jsr.io/@ryoppippi/curxy
MIT License
89 stars 8 forks source link

Cursor alert invalid key #15

Closed yuchaozhou closed 1 month ago

yuchaozhou commented 1 month ago

Start Server Command

OPENAI_API_KEY=sk-123456 deno run -A jsr:@ryoppippi/curxy

API ACCESS NORMAL

curl https://pn-circus-parental-should.trycloudflare.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-123456" -d '{ "messages": [ { "role": "system", "content": "You are a test assistant." }, { "role": "user", "content": "Testing. Just say hi and nothing else." } ], "model": "qwen2.5-coder:7b" }' {"id":"chatcmpl-603","object":"chat.completion","created":1726741526,"model":"qwen2.5-coder:7b","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"Hi"},"finish_reason":"stop"}],"usage":{"prompt_tokens":28,"completion_tokens":2,"total_tokens":30}}

Cursor ERROR

WX20240919-182648 WX20240919-182914

CURSOR INFO

Version: 0.40.4 VSCode Version: 1.91.1 Commit: 63dae81aea2c3fc079420fe72578a8eef26ba870 Date: 2024-09-05T02:52:05.660Z Electron: 29.4.0 ElectronBuildId: undefined Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 24.1.0

THX!

pedh commented 1 month ago

Confirmed. Cursor uses HTTP OPTIONS requests to identify supported HTTP methods, which are not supported by Ollama. This issue needs to be addressed in Curxy, as the original problem https://github.com/ollama/ollama/issues/3746 persists.

ryoppippi commented 1 month ago

@pedh Thank you for your debugging! Actually, I used the old ollama and haven't face this issue, maybe. I'll merge it