feat(llamaswap): add llama-swaps (TLS) DSN scheme
llama-swap was http-only by DSN, pushing TLS-fronted instances onto the openai:// scheme (which loses the management/image methods). Add a "llama-swaps" scheme that builds an https base URL, alongside "llama-swap" (http, local-first) — mirroring redis/rediss. Both share one factory; llama-swaps is scheme-only (no default built-in). The choice stays explicit because a DSN has no reliable http-vs-https signal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,11 +38,13 @@ features leak into the canonical API).
|
||||
`Unload` (POST `/api/models/unload[/:model]`). A small `doJSON` helper shares
|
||||
bearer auth + error mapping; non-2xx → `*llm.APIError` (so `llm.Classify`
|
||||
applies), transport errors wrapped raw.
|
||||
- DSN: the `llama-swap` scheme builds an **http://** base URL from the host
|
||||
(llama-swap is local-first), deliberately *not* the DSN's https-always
|
||||
`BaseURL()`. A TLS-fronted instance can use the `openai://` scheme for chat.
|
||||
A no-DSN built-in `llama-swap` provider registers but errors on use (mirrors
|
||||
foreman).
|
||||
- DSN: two schemes share one factory. `llama-swap` builds an **http://** base
|
||||
URL from the host (llama-swap is local-first), deliberately *not* the DSN's
|
||||
https-always `BaseURL()`; `llama-swaps` builds **https://** for a TLS-fronted
|
||||
instance (mirrors redis/rediss). Why a second scheme rather than auto-detect:
|
||||
a DSN carries no reliable http-vs-https signal, so the choice stays explicit.
|
||||
Only `llama-swap` registers a no-DSN built-in provider (errors on use, mirrors
|
||||
foreman); `llama-swaps` is a scheme only.
|
||||
- Image generation is implemented here too, against the new `imagegen`
|
||||
interface (see ADR-0016).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user