This project implements a dual-model proxy system for Cursor AI that combines the strengths of two different language models:
- A local Ollama model (Deepseek) for initial thought processing
- Claude (via OpenRouter) for final response generation
The proxy acts as a middleware that:
- Receives requests from Cursor
- Processes them through a local Ollama instance running Deepseek for initial thoughts
- Forwards the enhanced prompt to Claude via OpenRouter for final response generation
- Streams the response back to Cursor
- Create an account at OpenRouter
- Get your API key from the dashboard
- Open Cursor Settings
- Go to Model Settings
- Set your OpenAI API key to your OpenRouter API key
- Enter the URL of your proxy server (note: https, and not localhost. ngrok recommended)
- Select
gpt-4o
as your model
- Install Node.js and npm
- Install Ollama
- Pull the Deepseek model:
ollama pull deepseek-r1:1.5b
- Install dependencies:
npm install
- Start the server:
node src/index.js
The server will run on port 9000 by default.
- When you make a request in Cursor, it's sent to this proxy server
- The proxy first processes your request through the local Deepseek model to generate initial thoughts
- These thoughts are then combined with your original request and sent to Claude via OpenRouter
- Claude's response is streamed back through the proxy to Cursor
PORT
: Server port (default: 9000)- The OpenRouter API key is passed through the Authorization header from Cursor
- Ensure Ollama is running locally before starting the proxy
- The proxy must be running for Cursor to work with this setup
- All API keys should be kept secure and never committed to version control
If you encounter issues:
- Ensure Ollama is running (
ollama serve
) - Verify your OpenRouter API key is correctly set in Cursor
- Check that the proxy server is running
- Ensure port 9000 is available (or configure a different port)
Feel free to open issues or submit pull requests for improvements.
MIT