aboutsummaryrefslogtreecommitdiff
path: root/claude-templates
diff options
context:
space:
mode:
Diffstat (limited to 'claude-templates')
-rwxr-xr-xclaude-templates/bin/ai32
1 files changed, 17 insertions, 15 deletions
diff --git a/claude-templates/bin/ai b/claude-templates/bin/ai
index c09faab..c805e8b 100755
--- a/claude-templates/bin/ai
+++ b/claude-templates/bin/ai
@@ -11,9 +11,10 @@
# in the 'ai' session (new window or switch to existing).
# Use '.' for current directory. Git prep per dir.
#
-# ai --runtime <rt> Launch with a different agent CLI: claude (default) or
-# codex. 'local' is reserved for a local-LLM CLI, pending
-# the model evaluation. Also settable via AI_RUNTIME.
+# ai --runtime <rt> Launch with a different agent CLI: claude (default),
+# codex, or local (codex --oss against this machine's
+# ollama; model per AI_LOCAL_MODEL, default gpt-oss:120b).
+# Also settable via AI_RUNTIME.
#
# ai --attach Attach to the existing 'ai' session without changes.
#
@@ -30,20 +31,21 @@
SESSION="ai"
RUNTIME="${AI_RUNTIME:-claude}"
-
-# Map the runtime name to the agent CLI a pane launches. Both current CLIs
-# take the opening instructions as a positional prompt, so only the command
-# name varies; a runtime whose CLI needs different plumbing gets its own case.
+LOCAL_MODEL="${AI_LOCAL_MODEL:-gpt-oss:120b}"
+
+# Map the runtime name to the agent CLI a pane launches. All three take the
+# opening instructions as a positional prompt. AGENT_BIN is the binary the
+# dependency check probes; AGENT_CMD is the full launch command (the local
+# runtime rides codex's open-source provider against the machine's ollama —
+# model per AI_LOCAL_MODEL, default gpt-oss:120b, verified on ratio's
+# Strix Halo 2026-07-13).
resolve_agent_cmd() {
case "$RUNTIME" in
- claude) AGENT_CMD="claude" ;;
- codex) AGENT_CMD="codex" ;;
- local)
- echo "ai: the 'local' runtime is reserved but not wired yet (pending the local-model evaluation) — valid runtimes: claude, codex" >&2
- exit 2
- ;;
+ claude) AGENT_BIN="claude"; AGENT_CMD="claude" ;;
+ codex) AGENT_BIN="codex"; AGENT_CMD="codex" ;;
+ local) AGENT_BIN="codex"; AGENT_CMD="codex --oss --local-provider=ollama -m $LOCAL_MODEL" ;;
*)
- echo "ai: unknown runtime '$RUNTIME' — valid runtimes: claude, codex" >&2
+ echo "ai: unknown runtime '$RUNTIME' — valid runtimes: claude, codex, local" >&2
exit 2
;;
esac
@@ -73,7 +75,7 @@ usage() {
}
check_deps() {
- for cmd in fzf tmux "$AGENT_CMD"; do
+ for cmd in fzf tmux "$AGENT_BIN"; do
if ! command -v "$cmd" &>/dev/null; then
echo "ai: $cmd is not installed" >&2
exit 1