> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useslip.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Rulebook AI on an MBP

> Serve Ollama from a MacBook Pro over a trusted home LAN and consume it from Slip on another machine.

Slip calls Ollama only from the web server or an explicit SDK integration test. Wallet browsers never
receive the Ollama address and no provider credential is bundled into client JavaScript.

## Expose Ollama from the MBP

Ollama binds to loopback by default. For the Homebrew service used by this project, add these values
to the LaunchAgent environment and reload the service:

```bash theme={null}
PLIST="$HOME/Library/LaunchAgents/homebrew.mxcl.ollama.plist"
/usr/libexec/PlistBuddy -c "Add :EnvironmentVariables:OLLAMA_HOST string 0.0.0.0:11434" "$PLIST"
/usr/libexec/PlistBuddy -c "Add :EnvironmentVariables:OLLAMA_CONTEXT_LENGTH string 65536" "$PLIST"
/usr/libexec/PlistBuddy -c "Add :EnvironmentVariables:OLLAMA_NO_CLOUD string 1" "$PLIST"
launchctl bootout "gui/$UID" "$PLIST"
launchctl bootstrap "gui/$UID" "$PLIST"
```

Use `Set` instead of `Add` when a key already exists. A Homebrew upgrade may regenerate the
LaunchAgent, so verify these values after upgrading Ollama.

For the macOS Ollama application, the equivalent supported configuration is:

```bash theme={null}
launchctl setenv OLLAMA_HOST "0.0.0.0:11434"
launchctl setenv OLLAMA_CONTEXT_LENGTH "65536"
launchctl setenv OLLAMA_NO_CLOUD "1"
```

Quit and reopen the application. Confirm the exact model name and address on the MBP:

```bash theme={null}
ollama list
ipconfig getifaddr en0
curl http://127.0.0.1:11434/api/tags
```

`OLLAMA_CONTEXT_LENGTH` is an inference-server setting, not a settlement rule. Choose a value the
model and MBP memory support.

<Warning>
  A local Ollama API has no LAN authentication. Allow port 11434 only on a trusted network. Do not
  port-forward it from the router or expose it directly to the internet.
</Warning>

## Point Slip at the MBP

On the Mac mini or other host running Slip, use the MBP address and exact installed model:

```bash theme={null}
curl http://MBP_LAN_IP:11434/api/tags

export SLIP_RULE_PROVIDER=ollama
export SLIP_RULE_MODEL='qwen3.6:35b-mlx'
export OLLAMA_BASE_URL='http://MBP_LAN_IP:11434/api'
```

The `/api` suffix is required by the installed AI SDK Ollama provider. Keep the endpoint server-side;
do not add it to a `NEXT_PUBLIC_` variable.

Reserve the MBP address in the home router before treating a numeric LAN address as durable.

## Test real football language

Run the explicit live suite from the Slip workspace:

```bash theme={null}
pnpm --filter @slip/sdk test:ai:ollama
```

The suite sends five real requests to the configured model: five-band first-half corners, binary
both-teams-to-score, 1X2, second-half red cards, and an unsupported player-shots market. It validates
accepted outputs against canonical TxLINE keys and requires the player prop to fail closed. There is
no fake model or HTTP fixture.

Start the web server with the same variables. `POST /api/v1/compile` then uses the MBP, while Solana
signing and TxLINE proof settlement remain unchanged.

## Move to AI Gateway later

No compiler call site changes. Replace only server configuration:

```bash theme={null}
export SLIP_RULE_PROVIDER=gateway
export SLIP_RULE_MODEL='provider/current-model-id'
export AI_GATEWAY_API_KEY='...'
```

Both providers feed the same Zod schema and deterministic Rulebook validator.
