Connect Ollama (local or cloud) to Knit
Knit can use open-weight models served by Ollama. The key requirement: the Ollama endpoint must be a public HTTPS URL. For security, Knit blocks localhost and private IP addresses, so a purely local Ollama (http://localhost:11434) cannot be added directly — you must expose it publicly through a tunnel or reverse proxy, or use Ollama Cloud.
Before you start
- An Ollama instance — local (e.g. via ollama.com/download) or Ollama Cloud (ollama.com).
- A publicly reachable HTTPS URL for that instance (tunnel/reverse proxy for local; the hosted URL for Cloud).
- A Knit account, signed in.
Steps
- 1
Pull a model in Ollama
On your Ollama host, pull a model you want to use, for example llama3.1. This is the default model Knit assumes for Ollama.
ollama pull llama3.1
- 2
Expose Ollama on a public HTTPS URL
Knit rejects localhost and private IPs. For a local instance, put a tunnel or reverse proxy in front of it (for example a Cloudflare Tunnel or ngrok) to get a public https URL such as https://my-ollama.example.com. For Ollama Cloud, use https://ollama.com.
- 3
Open Knit settings → API Keys
In Knit, open /app, click the settings gear, and select the "API Keys (BYO)" tab.
- 4
Add the Ollama connection
Click add, label it (for example "My Ollama"), choose Ollama as the provider, and enter your public endpoint in the base URL field — this field is required for Ollama. The API key is optional: leave it empty for a local/self-hosted instance, or paste your token for Ollama Cloud (sent as an Authorization: Bearer header). Save.
- 5
Select your Ollama model and generate
Open a project, pick the Ollama connection, and choose a model from the list (read from the endpoint’s /api/tags). Describe your circuit and Knit will generate SkiDL, run it, and return the KiCad schematic — with zero Knit credits.
Frequently asked questions
- Can I connect Knit to http://localhost:11434?
- No. Knit blocks localhost, loopback and private IP addresses (an SSRF protection applied both when saving and at request time). To use a local Ollama, expose it on a public HTTPS URL with a tunnel or reverse proxy, then enter that URL as the base URL.
- Is an API key required for Ollama?
- No, the key is optional. A self-hosted Ollama is keyless, so you can leave the key blank. Ollama Cloud (https://ollama.com) does require a token, which Knit sends as an Authorization: Bearer header.
- What is required for an Ollama connection?
- The base URL is required and must be a public http(s) endpoint. The API key is optional. This is the opposite of the other providers, where the key is required and the base URL is optional.
- Which Ollama model does Knit use by default?
- The default Ollama model is llama3.1. Knit lists the models available on your endpoint (from /api/tags) so you can pick any model you have pulled.