Skip to content

Production Configuration ​

The names below describe the public 0.1.0 API. Provider-specific fields not listed here belong in transformRequest or the host gateway; do not put provider secrets into Agent state.

Provider ​

createAgent() from @karkata-ai/openai-compatible accepts:

FieldPurpose
modelRequired model id
baseURLRequired OpenAI-compatible HTTP root; use a server-side allowlist in production
apiKeyOptional API key; long-lived values belong on the server
headersStatic headers or a per-request header resolver
fetchInjectable Fetch implementation for proxies, tests, or runtime customization
maxRetriesRetries per model call; defaults to 2
transformRequestProvider compatibility fields; never log an unsanitized request

Agent ​

The agent object is passed to Core:

FieldDefaultPurpose
maxSteps20Limits model decision steps in one run
timeoutMs120000Limits one send() run
maxToolResultLength20000Limits one tool result entering context
maxInstructionsLength20000Limits dynamic instruction text
streaming.stateUpdateIntervalMs32Throttles partial-response state updates
streaming.maxOutputLength200000Limits output characters in one streaming step
contextBudgetDisabledHost-provided token estimation and optional history compaction
humanInputDisabledEnables requests waiting for user input

Choose values from model limits, cost, and tool side effects. Timeout and retries do not replace an idempotency design for upstream actions.

Environment variables ​

Environment variable names are not a fixed Karkata Core API. A deployment may use LLM_BASE_URL, LLM_API_KEY, and LLM_MODEL, validate them at startup, and pass them to the Provider after HTTPS and allowlist checks.