Skip to content

feat(install): autowire the unsloth gateway key with minimal manual steps - #1694

Merged
joelteply merged 1 commit into
canaryfrom
feat/unsloth-key-autowire
Jun 20, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/unsloth-key-autowire

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Why

New-user automation for the unsloth universal model gateway — capture UNSLOTH_API_KEY with as few manual steps as possible and persist it to config.env. No more hand-editing config.

Capture ladder (most-automated first)

Each candidate is validated against /v1/models (200) before persisting:

  1. UNSLOTH_API_KEY already in env or config.env (and still valid) → keep it.
  2. CLI auto-mint — unsloth connect claude --no-launch prints UNSLOTH_API_KEY=sk-... (unsloth mints + remembers it); we parse it. Works once a model is loaded in Studio.
  3. Paste prompt (TTY only) — open Studio, user creates a key, enter + validate (Claude-Code-style, 3 tries). Skipped headless/CI.

Grounded in what unsloth actually exposes

  • No REST key-mint endpoint (/studio/api/keys is just the SPA).
  • auth.db stores key hashes, not plaintext — can't read a key back out.
  • The CLI is the only programmatic mint, and it needs a loaded model.

So full zero-touch isn't possible; this gets as close as the engine allows.

Shape

  • Shared helper mod_unsloth_gateway_key in install-common.sh (both installers source it), wired into the [8/9] unsloth step.
  • Non-blocking + non-fatal: no key → the gateway provider just doesn't register; Continuum runs with another provider; headless/CI never blocks.

Validation

  • bash -n clean on both files.
  • Live: _unsloth_key_valid → 200 against the running /v1; mod_unsloth_gateway_key short-circuits with "✓ already configured + valid".

Remaining (#33)

Port the unsloth install + this key step into the public root install.sh (the curl path) — currently only in the tower installer. config.env single-owner (#34): the installer is a legitimate bootstrap writer; runtime owner stays Rust config_env.rs.

See memory unsloth-universal-model-gateway.

🤖 Generated with Claude Code

…teps

New-user automation for the unsloth universal model gateway: capture
UNSLOTH_API_KEY with as few manual steps as possible and persist it to
config.env. Shared helper in install-common.sh (both installers source it),
wired into the [8/9] unsloth step. NON-BLOCKING + NON-FATAL — no key just means
the gateway provider won't register; Continuum still runs with another
provider (solve-for-public-users), and headless/CI never blocks.

Capture ladder (most-automated first), each validated against /v1/models (200)
before persisting:
  1. UNSLOTH_API_KEY already in env or config.env (and still valid) → keep it.
  2. unsloth CLI auto-mint — `unsloth connect claude --no-launch` prints
     UNSLOTH_API_KEY=sk-... (unsloth mints + remembers it); we parse it.
     Works once a model is loaded in Studio.
  3. Interactive paste prompt (TTY only) — open Studio, user creates a key,
     enter + validate (Claude-Code-style, 3 tries). Skipped headless/CI.

Grounded in what unsloth actually exposes: no REST key-mint endpoint; auth.db
stores key HASHES not plaintext (can't read a key back); the CLI is the only
programmatic mint, and it needs a loaded model. So full zero-touch isn't
possible — this gets as close as the engine allows.

Live-validated: _unsloth_key_valid → 200 against the running /v1; the
already-configured path short-circuits correctly.

Remaining for #33: port the unsloth install + this key step into the PUBLIC
root install.sh (curl path) — it currently lives only in the tower installer.
config.env single-owner (#34): the installer is a legitimate bootstrap writer;
runtime owner stays Rust config_env.rs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit e434030 into canary Jun 20, 2026
3 checks passed
@joelteply
joelteply deleted the feat/unsloth-key-autowire branch June 20, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant