getcursor / cursor

The AI Code Editor
https://cursor.com
23.96k stars 1.51k forks source link

Support base_url for Anthropic Series Models #1936

Open Hambaobao opened 2 weeks ago

Hambaobao commented 2 weeks ago

Dear Developers,

We hope you can enable the Anthropic series models to allow specifying a base_url, just like the OpenAI series models.

Thank you!

danperks commented 2 weeks ago

If you only want to use Anthropic models, I believe overriding the OpenAI URL will actually override the URL for all the customer API key endpoints, so try enter it in there and give it a test - I may be wrong!

Hambaobao commented 2 weeks ago

Thank you for your response.

I have conducted some tests and discovered that overriding OpenAI’s base_url successfully allows me to invoke models whose names do not include claude-. However, when the model name contains claude-, Cursor still appears to call the model through https://api.anthropic.com/v1/messages. Currently, I have aliased claude-3-5-sonnet-20240620 as custom-cursor. Nonetheless, I suspect that Cursor uses different prompts and post-processing methods when invoking different models, as the user experience with the current setup feels significantly inferior to the native experience.

Therefore, I believe it is necessary to provide a similar base_url modification feature for the Anthropic series of models.