Use your own model endpoint
Add a vLLM, SGLang, Ollama or LiteLLM server or any OpenAI compatible API, and publish a server of your network with Cloudflare Tunnel.
On this page
Besides OpenAI, Anthropic, DeepSeek and OpenRouter, Kosken can use any server with the OpenAI Chat Completions API. It can be a model that you serve yourself with vLLM, SGLang, Ollama or LiteLLM, or a hosted service with that API. Only an owner of the workspace can add an endpoint.
What the endpoint needs
- A public https address. Kosken calls the endpoint from its own servers. It refuses plain http, and it refuses private and local addresses such as
10.0.0.5,192.168.1.20orlocalhost. For a server on your own network, see Publish a server of your network. - Tool calls. The roles of Kosken call tools. The model must call tools through the API, and the server must allow it. vLLM, for example, needs
--enable-auto-tool-choiceand a--tool-call-parserfor the model. - A key, if the endpoint is on the internet. Kosken sends the key as
Authorization: Bearer. With vLLM, start the server with--api-key.
Add an endpoint
- Click your name at the top right, then click Settings.
- Click the LLM tab.
- In Connect a provider, find Your own endpoint and click Add an endpoint.
- Type a Name, such as
vLLM lab. The role list shows this name before each model. - Type the Base URL: the address before
/chat/completions, which usually ends in/v1. For example,https://llm.example.com/v1. - Paste the API key, if the endpoint has one.
- If the endpoint needs other headers, type them in Extra headers, one per line, as
Name: value. - Click Save and test.
Kosken reads /models from the endpoint. If the endpoint refuses the key or the headers, Kosken does not store it. If the endpoint answers, Kosken seals the URL, the key and the headers for this workspace, and step 2 shows the models of the endpoint. If the server has no model list, add the model by its id in Add a model by id.
A workspace can have 5 endpoints.
The tool test
When you switch on a model of your endpoint, Kosken sends it one short request with a test tool, and the model must call the tool. If the server refuses tools, or the model answers with text only, the model stays Off and the app shows why. For vLLM, the usual fix is to restart the server with these flags:
vllm serve Qwen/Qwen3-32B --api-key "$VLLM_KEY" --enable-auto-tool-choice --tool-call-parser hermes
The parser depends on the model: hermes for Qwen models, llama3_json for Llama 3.1 and later, and mistral for Mistral models. The vLLM documentation lists the others.
Use the models
A model of your endpoint works like any other model. Switch it on in step 2, then choose it for a role in step 3. See Assign a model to each role.
- Kosken asks for JSON answers with
response_formatof typejson_object, and puts the schema in the prompt. - If you choose a Thinking mode for a role, Kosken sends
enable_thinkinginchat_template_kwargs, as vLLM and SGLang read it for models such as Qwen3. If you choose a Reasoning effort, Kosken sendsreasoning_effort. Leave both on Default if your server does not accept them. - The Embeddings role cannot use a model of your endpoint.
- Kosken does not know the price of your model, so usage shows tokens only.
Publish a server of your network
Kosken cannot reach a private address. To use a model that runs on your own network, publish it with a tunnel. The tunnel makes an outbound connection from your network, so you do not open a port in your firewall.
Cloudflare Tunnel
You need a Cloudflare account with a domain. In this example, the model server listens on port 8000 of the host that runs the tunnel, and the public name is llm.example.com.
- Start the model server with a key, so that only Kosken can use it. With vLLM, add
--api-key. - On the host, install
cloudflaredfrom the Cloudflare documentation, then sign in and create the tunnel:cloudflared tunnel login cloudflared tunnel create kosken-llm cloudflared tunnel route dns kosken-llm llm.example.com - Write
~/.cloudflared/config.yml. Use the tunnel id and the credentials file thattunnel createprinted:tunnel: TUNNEL-ID credentials-file: /home/you/.cloudflared/TUNNEL-ID.json ingress: - hostname: llm.example.com service: http://localhost:8000 - service: http_status:404 - Run the tunnel. To keep it running after a restart, install it as a service with
sudo cloudflared service install.cloudflared tunnel run kosken-llm - In Kosken, add the endpoint with the base URL
https://llm.example.com/v1and the key of the model server.
For a second lock, put the name behind Cloudflare Access. In Cloudflare Zero Trust, create a service token, then an Access application for llm.example.com with a Service Auth policy that allows that token. In Kosken, type the two values of the token in Extra headers:
CF-Access-Client-Id: 1a2b3c4d.access
CF-Access-Client-Secret: the secret of the token
Cloudflare ends a request that takes more than 100 seconds. Kosken waits for the full answer, so a slow model with a long answer can hit that limit. Set Max output tokens on the roles, or use a faster model.
Other tunnels
- Tailscale Funnel.
tailscale funnel 8000publishes port 8000 at an https name of your tailnet, such ashttps://gpu-01.example.ts.net. Funnel must be on for your tailnet. - A reverse proxy. A host with a public address, such as nginx or Caddy with a certificate, can forward to the model server over a VPN.
With any tunnel, keep the key on the model server: the public name can be reached by anyone on the internet.
Change or delete an endpoint
- To change the name, the URL, the key or the headers, click Edit on the endpoint, change the fields, and click Save and test. Leave the key or the headers empty to keep the saved ones.
- To delete an endpoint, click Delete. Calls to its models fail after that, and the roles that use them show needs attention until you choose another model.
Your data
Kosken redacts the context of a task before it sends it to any model, also to your own endpoint. The URL, the key and the headers are sealed with the keys of the workspace. The settings page shows the URL and the last four characters of the key, never the key or the headers.
Something here does not match the app? Tell us