ollama/api
Patrick Devine 5968989a7f server: add authorized_keys file
This change adds an "authorized_keys" file similar to sshd which can control
access to an Ollama server. The file itself is very simple and consists of
various entries for Ollama public keys.

The format is:

<key format> <public key> <name> [<endpoint>,...]

Examples:

ssh-ed25519 AAAAC3NzaC1lZDI1NT... bob /api/tags,/api/ps,/api/show,/api/generate,/api/chat

Use the "*" wildcard symbol to substitute any value, e.g.:

To grant full access to "bob":
ssh-ed25519 AAAAC3NzaC1lZDI1NT... bob *

To allow all callers to view tags (i.e. "ollama ls"):
* * * /api/tags

- The key format must be set to "ssh-ed25519" or set to the wildcard character.
- The public key must be an ssh based ed25519 (Ollama) public key or set to the wildcard
  character.
- Name can be any string you wish to associate with the public key. Note that if a public
  key is used in more than one entry in the file, the first instance of the name will be
  used and subsequent name values will be ignored.
- Endpoints is a comma separated list of Ollama Server API endpoints or the wildcard
  character. The HTTP method is not currently needed, but could be added in the future.
2025-07-29 20:50:01 -07:00
..
examples docs: improve syntax highlighting in code blocks (#8854) 2025-02-07 09:55:07 -08:00
client.go server: add authorized_keys file 2025-07-29 20:50:01 -07:00
client_test.go server: add authorized_keys file 2025-07-29 20:50:01 -07:00
types.go API/CLI context enhancements (#11331) 2025-07-08 11:59:06 -07:00
types_test.go add thinking support to the api and cli (#10584) 2025-05-28 19:38:52 -07:00