-
Notifications
You must be signed in to change notification settings - Fork 0
Per Player Keys and Models
By default a server shares one API key (set by an admin) and one model. On a busy server that can mean one person pays for everyone's AI usage. Blockpal 3.3.0 adds two things to fix that:
- Bring-your-own-key (BYOK) — make players use their own API key.
- Player-selectable models — let players pick their bot's model from a list you curate.
Both are off-impact by default: a fresh/updated server keeps working exactly as before (shared key, model choice on with a starter list).
/ai admin requirekey on # players must use their own key
/ai admin requirekey off # back to the shared key for everyone (default)
You can also toggle Require own API key in the Admin panel.
A bot is owned by the player who summoned it. For each request Blockpal picks the key:
- The owner's personal key, if they've set one — always wins (their bot, their bill).
- Otherwise, if BYOK is on and the owner is not whitelisted → no key: the
bot politely says it needs one (
/ai mykey <token>). - Otherwise → the shared server key.
So even with BYOK off, any player may set a personal key to use their own model/quota.
/ai mykey <token> # set your personal key
/ai mykey clear # remove it
/ai mykey # show whether you have one set
/ai mymenu # do it (and pick a model) in a private screen
Keys are stored obfuscated per-player and are never shown to other players or
written to the log. Typing a token in chat can briefly expose it to anyone reading —
prefer /ai mymenu (a GUI field) when you can. See Security.
Trusted players can keep using the shared key even when BYOK is on:
/ai admin keylist add <player>
/ai admin keylist remove <player>
/ai admin keylist list
Entries are usernames (case-insensitive). Example: turn BYOK on for the public, but whitelist your moderators so they keep using the house key.
/ai admin models list
/ai admin models add <model-id> # e.g. meta-llama/Llama-3.1-8B-Instruct
/ai admin models remove <model-id>
The list is seeded with a few common models on first run, and the server default model (set in the Settings panel's AI tab) is always kept on it. Removing the default isn't allowed — change the default first if you need to.
Model ids are cleaned automatically (3.20.0) — stray spaces, quotes and invisible
paste artifacts are stripped wherever an id is entered. Adding an id that names a
quantized download bundle (…-GGUF, …-GPTQ, …-AWQ) gets an immediate warning:
those repos are files for local apps, not hosted API models — use the base id (e.g.
Qwen/Qwen2.5-Coder-3B-Instruct, not …-Instruct-GGUF). See
Troubleshooting for the full story.
/ai models # list the allowed models (your current one is marked)
/ai model <model-id> # use this model for your bot
/ai mymenu # pick from a dropdown in a screen
A player's pick only applies if it's on the allowed list. Turn the whole feature off (everyone uses the server default) with the Players may pick model toggle in the Admin panel.
Everything lives in config/blockpal/config.json:
| Key | Meaning |
|---|---|
requireOwnApiKey |
BYOK on/off (default false) |
ownKeyWhitelist |
Usernames exempt from BYOK |
playerApiKeysObf |
Per-player keys, obfuscated, keyed by UUID |
allowPlayerModelChoice |
Whether players may pick a model (default true) |
allowedModels |
The models players may choose from |
playerModels |
Each player's chosen model, keyed by UUID |
See also: Settings, Commands, Security, Admin Menu.
Blockpal — a Minecraft Fabric AI companion mod · default companion Ethan · Report an issue · MIT License
Start here
Using the mod
- Commands
- Talking to Your Assistant
- Client-Side Assistant
- Possession Mode
- Voice
- Settings
- Performance Presets
- Custom Skins
- Personalities
- Trust & Per-Bot Management
- Running Commands
- AI Actions
- Vision & Code
- PVT — learning by watching
- Speed & Combat
- Bedrock (Geyser)
- Bedrock Add-On (single-player)
Multiplayer & games
AI providers
- MCP server (Claude/ChatGPT/Grok/Gemini)
- Local AI on your GPU
- Local & Player2 AI
- Per-Player Keys & Models
Admin & safety
Reference