Use Your Gateway with Cline or Open WebUI
Cline (VS Code)
- Open Cline's settings.
- Set API Provider to Ollama. OpenAI Compatible also works.
- Tick Use custom base URL and paste your gateway address, such as
https://YOUR-ID.llm.cdnshark.com. - Paste your API key.
- Pick or type the model name, such as
qwen2.5-coder:7b.
The model list is empty? Cline's Ollama provider loads the list without sending your key, so the gateway refuses it. Either type the model name by hand, or switch on Allow the model list without an API key on your gateway page. That only opens the model list. Chatting always needs the key.
Open WebUI
- Go to Settings → Connections.
- Add an Ollama API connection, or an OpenAI API one, with your gateway address as the URL and your key.
- Your models appear in the model picker.
Getting good results from coding assistants
Coding assistants such as Cline send long instructions with every request and expect the model to answer in a strict format. Two things make a big difference:
- Use a model big enough for the job. Very small models, around 1–3 billion parameters, often reply with raw JSON or made-up tool calls instead of a normal answer. That comes from the model, not the gateway. A coding model of 7 billion parameters or more, such as
qwen2.5-coder:7b, works much better. - Give the model enough context. Ollama uses a small context window by default and silently cuts off anything longer, so the assistant's instructions get lost. Start Ollama with a larger one, for example:
A larger context uses more memory on your machine.OLLAMA_CONTEXT_LENGTH=32768 ollama serve