JIXU DOCUMENTATION
jixu-llm
Provider-neutral model capability resolution and first-party LLM Drivers.
jixu-llm adapts supported provider wire protocols to the ModelDriver contract from jixu-core. It normalizes streaming text, Tool calls, Plan and progress controls, failures, cancellation, image input, and accounting without making provider state authoritative.
Install
npm install jixu-core jixu-llmConnect a model
import { defineAgent } from "jixu-core";
import {
createLLMModelDriver,
resolveLLMModelCapabilities,
} from "jixu-llm";
const connection = {
api: "openai-chat-completions" as const,
apiKey: process.env.MODEL_API_KEY,
baseURL: "https://api.openai.com/v1",
model: "gpt-5.6-sol",
};
const modelCapabilities = await resolveLLMModelCapabilities(connection);
const agent = defineAgent({
instructions: "Be precise.",
model: { provider: "model", model: connection.model },
modelCapabilities,
});
const modelDriver = createLLMModelDriver({
api: connection.api,
apiKey: connection.apiKey,
baseURL: connection.baseURL,
maxOutputTokens: modelCapabilities.maxOutputTokens,
});Bind the Driver under the same provider key used by the Agent: modelDrivers: { model: modelDriver }.
Supported protocols
| API value | Wire protocol |
|---|---|
openai-chat-completions | OpenAI-compatible Chat Completions streaming |
anthropic-messages | Anthropic Messages streaming |
OpenAI Responses is not part of the current first-party boundary. One configured request uses one protocol; there is no hidden protocol or model fallback.
Capability resolution
resolveLLMModelCapabilities() resolves the exact protocol, Base URL, and model before Agent creation. It prefers authoritative endpoint metadata, uses the versioned built-in catalogue only for recognized direct endpoints, and accepts an explicit declaration for a custom deployment:
const modelCapabilities = await resolveLLMModelCapabilities({
...connection,
explicit: {
contextWindowTokens: 128_000,
maxOutputTokens: 16_384,
},
});Unknown or partial capability data fails closed instead of guessing. The accepted profile becomes immutable Agent data for every Thread owned by that Harness.
Operational guarantees
- SDK retries are disabled; retries remain visible in the durable Effect path.
- Secrets stay behind the Driver boundary and provider errors are redacted.
- Provider-reported usage becomes canonical accounting; unavailable fields remain unknown.
- Ordered text and verified image Artifacts map into both supported protocols.
standardpreserves provider defaults;ultraapplies the strongest compatible effort mapping without changing the model.
See Framework setup for the complete Harness composition.