{
  "scope": "Public retained example and task-specific verification checklist; no inference or correction executed.",
  "repairId": "fix-llamacpp-native-schema-envelope",
  "repairURL": "https://kingy.ai/ai-fix-finder/fix-llamacpp-native-schema-envelope/",
  "example": {
    "request": {
      "prompt": "<|im_start|>user\nExtract the id 17 and text ALPHA from this sentence into the required JSON response structure. No commentary.<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n",
      "temperature": 0,
      "seed": 42,
      "n_predict": 256,
      "cache_prompt": false,
      "response_format": {
        "type": "json_schema",
        "json_schema": {
          "name": "record",
          "schema": {
            "type": "object",
            "properties": {
              "kingy_record": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "const": 17
                  },
                  "text": {
                    "type": "string",
                    "const": "ALPHA"
                  }
                },
                "required": [
                  "id",
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kingy_record"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "response": {
      "index": 0,
      "content": "{\"id\": 17, \"text\": \"ALPHA\"}",
      "tokens": [],
      "id_slot": 0,
      "stop": true,
      "model": "kingy-repair-fixture",
      "tokens_predicted": 15,
      "tokens_evaluated": 34,
      "generation_settings": {
        "seed": 42,
        "temperature": 0.0,
        "dynatemp_range": 0.0,
        "dynatemp_exponent": 1.0,
        "top_k": 40,
        "top_p": 0.949999988079071,
        "min_p": 0.05000000074505806,
        "top_n_sigma": -1.0,
        "xtc_probability": 0.0,
        "xtc_threshold": 0.10000000149011612,
        "typical_p": 1.0,
        "repeat_last_n": 64,
        "repeat_penalty": 1.0,
        "presence_penalty": 0.0,
        "frequency_penalty": 0.0,
        "dry_multiplier": 0.0,
        "dry_base": 1.75,
        "dry_allowed_length": 2,
        "dry_penalty_last_n": 64,
        "dry_sequence_breakers": [
          "\n",
          ":",
          "\"",
          "*"
        ],
        "mirostat": 0,
        "mirostat_tau": 5.0,
        "mirostat_eta": 0.10000000149011612,
        "adaptive_target": -1.0,
        "adaptive_decay": 0.8999999761581421,
        "stop": [],
        "max_tokens": 256,
        "n_predict": 256,
        "n_keep": 0,
        "n_discard": 0,
        "ignore_eos": false,
        "stream": false,
        "logit_bias": [],
        "n_probs": 0,
        "min_keep": 0,
        "grammar": "",
        "grammar_lazy": false,
        "grammar_triggers": [],
        "preserved_tokens": [],
        "chat_format": "Content-only",
        "reasoning_format": "deepseek",
        "reasoning_in_content": false,
        "generation_prompt": "",
        "samplers": [
          "penalties",
          "dry",
          "top_n_sigma",
          "top_k",
          "typ_p",
          "top_p",
          "min_p",
          "xtc",
          "temperature"
        ],
        "speculative.types": "none",
        "timings_per_token": false,
        "post_sampling_probs": false,
        "backend_sampling": false,
        "lora": []
      },
      "prompt": "<|im_start|>user\nExtract the id 17 and text ALPHA from this sentence into the required JSON response structure. No commentary.<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n",
      "has_new_line": false,
      "truncated": false,
      "stop_type": "eos",
      "stopping_word": "",
      "tokens_cached": 48,
      "timings": {
        "cache_n": 0,
        "prompt_n": 34,
        "prompt_ms": 3114.108,
        "prompt_per_token_ms": 91.59141176470588,
        "prompt_per_second": 10.918054222910701,
        "predicted_n": 15,
        "predicted_ms": 3175.718,
        "predicted_per_token_ms": 226.837,
        "predicted_per_second": 4.408451883951913
      }
    },
    "endpoint": "/completion",
    "context": null,
    "note": "Retained repair 010 example, originally qualified 2026-10-16. This preview sends no request and does not retest the model.",
    "repairId": "fix-llamacpp-native-schema-envelope",
    "runtime": "llamacpp",
    "checks": [
      "Record the actual endpoint and serialized request body. The frozen example uses native /completion, not /v1/chat/completions.",
      "Move the identical schema from the misplaced Chat API response_format envelope to native top-level json_schema. Keep the rendered prompt, seed, temperature and output cap unchanged.",
      "Validate the original contract: {\"kingy_record\":{\"id\":17,\"text\":\"ALPHA\"}}. Do not weaken it to accept the unwrapped baseline.",
      "Require complete EOS termination without truncation. Preserve the raw response so well-formed JSON is not mistaken for schema compliance."
    ],
    "correction": "For native POST /completion, pass the unchanged schema in top-level json_schema. Use the documented Chat API response_format shape only with its corresponding chat endpoint.",
    "evidenceDate": "2026-10-16"
  }
}
