CDNShark Documentation

Private LLM Gateway

← Back to Documentation

Use Your Gateway with Cline or Open WebUI

Cline (VS Code)

  1. Open Cline's settings.
  2. Set API Provider to Ollama. OpenAI Compatible also works.
  3. Tick Use custom base URL and paste your gateway address, such as https://YOUR-ID.llm.cdnshark.com.
  4. Paste your API key.
  5. 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

  1. Go to Settings → Connections.
  2. Add an Ollama API connection, or an OpenAI API one, with your gateway address as the URL and your key.
  3. 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:
    OLLAMA_CONTEXT_LENGTH=32768 ollama serve
    A larger context uses more memory on your machine.