Agent skill · caffeinelabs

extension-inference

MANDATORY recipe for every Caffeine build that calls an LLM, chatbot, GPT, or ChatGPT **on Caffeine Inference** (no user-pasted OpenAI key). The ONLY supported path is the `caffeineai-inference-client` mops package with `Config.fromEnv<system>()`, which hands the canister a ready-to-use authenticated config — the app never asks for, stores, or returns a key. Hand-rolling `ic.http_request` to `inference.caffeine.ai` (or `api.openai.com`) is a FORBIDDEN anti-pattern. Load this skill whenever the user, spec, or any prior task wants an LLM in a Caffeine app — and BEFORE writing any code that talks to an LLM host. Use `extension-openai` only when the spec explicitly requires a user- or admin-pasted `sk-...` key against `api.openai.com`.

What it needs

About 4k tokens when loaded.

What this skill does

Caffeine Inference LLM extension for Caffeine AI. Orchestrator routing notes Treat “use an LLM / GPT / chatbot / summarise with AI” as a first-class platform feature. The default path is Caffeine Inference: an OpenAI-compatible chat endpoint that Caffeine hosts, authenticates, and bills for the app. The canister gets its credentials from the platform at runtime; nobody pastes an API key, and the app never stores or returns one. User intent Capability --- --- Chat / summarise / classify with an LLM in a Caffeine app caffeineai-inference-client ChatApi.createChatCompletion via this skill Call api.openai.com with a user-pasted sk-... extension-openai only Do not load extension-openai for a normal Caffeine-app LLM. Do not ask the user for an OpenAI API key. Do not add setApiKey endpoints, a key-settings page, or a model picker. Backend 1. Add caffeineai-inference-client to mops.toml Requires Mops ≥ 2.13. Minimum version: caffeineai-inference-client ≥ 0.1.0. 2. Config comes from the platform Config.fromEnv<system>() returns a complete Config — endpoint, bearer, and isreplicated = ?false — from the credentials the platform provisions for the app. There is no key to collect and nothing to configure. Call fromEnv<system>() inside the shared method, or in a <system>-parameterised helper, on every request. A module-level let config = fromEnv will not compile, and a cached Config can go stale when the platform rotates credentials on a running canister. It traps when the app has no inference credentials. That is a platform condition, not something the app can fix — do not add a "configure AI" empty state or a key-input fallback for it. Never log the Config, never copy its auth into actor state, and never return it (or any part of it) from a query / shared function. 3. isreplicated = ?false is REQUIRED fromEnv already sets this. Do not override it to ?true or null. 1. Security. A replicated outcall sends the bearer from every replica. 2. Billing. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills caffeinelabs/extension-inference

View the source on GitHub

Browse the @skills marketplace