stella-llm
Call language models through Stella's managed LLM relay using the user's Stella auth. Use when a Stella-created app, runtime helper, script, or integration needs LLM capabilities without direct provider API keys.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- stella-llm
- description
- Call language models through Stella's managed LLM relay using the user's Stella auth. Use when a Stella-created app, runtime helper, script, or integration needs LLM capabilities without direct provider API keys.
03 SKILL.md 正文
Stella Managed LLM Calls
Stella ships a managed language-model helper. Use it when you need LLM capabilities inside Stella, a Stella-created app, a local script, or an integration and the request should use Stella auth, billing, model access, and backend-held provider keys.
Do not call provider APIs directly unless the user explicitly asks for a direct provider integration. Direct calls bypass Stella's auth, quotas, billing, model catalog, logging, and key isolation.
Use the Helper
For desktop renderer code and Stella-created apps, import the helper:
import { callStellaLlmText } from "@/platform/ai/llm";
const title = await callStellaLlmText("Name this note in five words.", {
systemPrompt: "Return only the title text.",
});
For structured calls:
import { callStellaLlm, extractChatText } from "@/platform/ai/llm";
const response = await callStellaLlm({
agentType: "my-app",
model: "stella/light",
systemPrompt: "Return valid compact JSON.",
prompt: "Return a short JSON label for this task.",
body: { response_format: { type: "json_object" } },
});
const text = extractChatText(response);
The helper handles the Stella endpoint, bearer auth, device header, and default
model. Callers should pass only prompt, optional systemPrompt, or explicit
messages, plus small options such as agentType, model, maxTokens,
temperature, or extra request-body fields.
Prompt, System Prompt, and Context
Use prompt for the immediate user/app request and systemPrompt for behavior
instructions:
await callStellaLlmText("Suggest a filename.", {
systemPrompt: "Return one kebab-case filename without an extension.",
});
Use messages only when the integration wants to provide its own chat history,
examples, or context. These are OpenAI-style chat messages owned by the caller;
they are not Stella's saved conversation transcript.
const response = await callStellaLlm({
systemPrompt: "Continue the user's planning context.",
messages: [
{ role: "user", content: "I have ten minutes before a meeting." },
{ role: "assistant", content: "Prioritize one small task." },
],
prompt: "What should I do now?",
});
If both messages and prompt are provided, the helper sends:
systemPrompt, then messages, then the final prompt.
Model and Streaming
The model is optional. Omit it for Stella's default managed model, or pass a Stella alias when the task needs a specific behavior:
await callStellaLlmText("Explain this bug in one sentence.", {
model: "stella/builder",
});
Streaming is optional. Omit stream for a parsed JSON response. Set
stream: true when the caller wants the raw streamed HTTP response and will
consume it itself:
const response = await callStellaLlm({
prompt: "Draft a long outline.",
stream: true,
});
for await (const chunk of response.body ?? []) {
// Consume the provider-compatible stream.
}
Runtime and Script Code
If you are in lower-level runtime code that already uses Stella's model router, prefer that route instead of hand-written HTTP:
resolveLlmRoute(...)for provider-aware runtime execution.runOneShotCompletion(...)for short internal text completions.
If you truly need raw HTTP in a Node script, use the canonical runtime env names
only: STELLA_LLM_PROXY_URL and STELLA_LLM_PROXY_TOKEN. Do not introduce
new env var names or provider API keys.
Models
The helper defaults to Stella's standard model. Only pass model when the task
really needs a different Stella model. Prefer Stella aliases such as
stella/default, stella/light, or stella/builder over provider-native IDs.
Usage Rules
- Keep prompts and outputs scoped to the user task. Do not send secrets, private files, or large unrelated context.
- Use
callStellaLlmTextfor plain text andcallStellaLlmfor structured responses or streaming. - Treat
messagesas caller-owned context, not Stella chat persistence. - Do not manually build
/api/stellaURLs in app code when the helper can do it. - Handle
401as signed out and ask the user to sign in to Stella. - Handle
429as model quota/subscription/rate-limit state and surface the backend message. - Handle
503as backend provider configuration unavailable; do not ask the user for a provider key.
Backlinks
04 同仓库更多 Skills
stella-computer
Control Linux desktop apps (Hyprland) through Stella's persistent Computer Use runtime.
stella-browser
暂无简介
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
x-api
Use X (Twitter) through Stella's connected account.
visual-craft
Read before making something people will look at, where the look is the work — a website or landing page, an HTML canvas or interactive piece, an animation or motion graphics, a video, an image, or a visual design. Not for routine UI fixes or code whose output isn't visual.
stella-office
Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using Stella's bundled `stella-office` CLI. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents.