Set model

Session.SetModel on the one SDK, pkg/abox.

Switch profile after boot (config.yaml name). Default openai-default; pass another name as os.Args[1]. Needs that provider’s key.

CLI

Profile name from ~/.abox/config.yaml (grok-default, openai-default, claude-default, or a name you added):

abox --model openai-default
abox exec --model openai-default --prompt "Name the model you are."

Needs that provider’s key. Mid-session switch in the TUI is /provider (paste a key) or /credential (cloud pointer) — not a profile rename. SetModel after boot is SDK-only.

SDK

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/AdminTurnedDevOps/ABox/pkg/abox"
)

func main() {
	profile := "openai-default"
	if len(os.Args) > 1 {
		profile = os.Args[1]
	}
	ctx := context.Background()
	sess, err := abox.Open(ctx, abox.Options{})
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	defer sess.Close()
	if err := sess.SetModel(ctx, profile); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	fmt.Println("using", profile)
	_, err = sess.Turn(ctx, "Name the model you are.", func(ev abox.Event) {
		if ev.Kind == "text" {
			fmt.Print(ev.Text)
		}
	})
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	fmt.Println()
}