Skip to content

Config file reference ​

Every key of .llmockrc.json. For how presets work and when changes apply, see Configuration.

Full example ​

json
{
  "defaultModel": "chatgpt",
  "models": {
    "chatgpt": {
      "name": "openai",
      "model": "gpt-4o",
      "endpoint": "chatgpt/chat/completions",
      "responseType": "lorem",
      "maxLoremParas": 8,
      "validateRequests": true,
      "logRequests": true,
      "debug": false,
      "stream": false,
      "responseDelay": {
        "min": 3000,
        "max": 5000
      },
      "embeddings": {
        "enabled": true,
        "dimensions": 128
      },
      "chaos": {
        "enabled": false,
        "frequency": 1,
        "mode": "every",
        "status": 500,
        "kind": "http",
        "afterChunks": 2
      }
    }
  },
  "server": {
    "port": 8001,
    "host": "0.0.0.0"
  }
}

Preset keys ​

OptionDescription
nameRequired. LLM provider name (used for template loading)
modelModel identifier (e.g. gpt-4o, gemini-pro)
endpointRequired. API endpoint path (not v1/embeddings while embeddings are enabled)
responseType"lorem" (random text) or "stored" (predefined responses)
storedResponsesFileOptional JSON file of your own texts for "stored" (see Generated and stored replies)
recordingsOptional { "dir", "upstream" }: replay recorded replies from dir, and with upstream record new ones (see Recording real replies)
maxLoremParasMax sentences in lorem ipsum responses
validateRequestsValidate incoming requests against templates
logRequestsSave the most recent requests to the log file
maxLoggedRequestsHow many requests the log keeps (default 10, at most 100)
debugEnable verbose console logging
streamReturn SSE streaming responses. For openai presets, only for requests that don't send their own stream: true/false; ignored by the claude preset, which decides per request
responseDelay.min/maxResponse delay range in milliseconds (see Response delays)
responseRulesOptional list of { match, file } or { match, files } fixture replies, each with an optional stopReason, or { match, fail } to fail the calls that match (see Response rules)
chaos.enabledFail some calls (see Chaos mode)
chaos.frequencyFail 1 in this many calls (default 1, every call)
chaos.mode"every" (each Xth call, the default) or "random" (a 1 in X chance per call)
chaos.statusHTTP status of the error, 400 to 599 (default 500)
chaos.kindWhat a failing call gets: "http" (an HTTP error, the default), "stream-error", "stream-drop" or "stream-stall" (see Stream failures)
chaos.afterChunksHow many content deltas a failing stream sends first, 0 or more (default 2)
embeddings.enabledEnable the /v1/embeddings endpoint
embeddings.dimensionsEmbedding vector size

Server keys ​

OptionDescription
server.port / server.hostPort and address the server listens on (8001, 0.0.0.0)
server.adminfalse turns the admin API off (default true)
server.uiThemeColours of the dashboard: "dark" (the default) or "light"
server.llmspytrue, or LLMSpy's address such as "http://127.0.0.1:9090": print the LLMSpy upstream and base URL at start, and show them on the dashboard (see Using with LLMSpy). Off by default

Defaults ​

Only name and endpoint are required in a preset. Anything left out uses: responseType lorem, maxLoremParas 8, maxLoggedRequests 10, no delay, and validation, logging, debug, streaming, embeddings and chaos off.

Released under the MIT License.