{
  "openapi": "3.1.0",
  "info": {
    "title": "LocalFit measurements API",
    "version": "1.0.0",
    "summary": "Read-only observed local-LLM speed and GPU memory measurements.",
    "description": "Public, read-only access to the LocalFit measurement catalog: Ollama generation speed, cold load time and incremental GPU memory per model tag and GPU. No authentication, no writes, no accounts. A GPU or model with no run in the catalog is reported as untested; speeds and memory are never inferred from another GPU or run. Each run is a single observation, so read methodology.limitations before quoting one. The same data is available to MCP clients: POST /mcp is a stateless Streamable HTTP endpoint (JSON-RPC 2.0, protocol versions 2025-11-25, 2025-06-18 and 2025-03-26) with one read-only tool, get_measurements, taking the same gpuId and tag filters. Agent instructions: /llms.txt."
  },
  "servers": [
    {
      "url": "https://localfit.vibefrontier.com"
    }
  ],
  "paths": {
    "/measurements.json": {
      "get": {
        "operationId": "getMeasurements",
        "summary": "The complete measurement catalog",
        "description": "The checked-in dataset every other interface is derived from: all GPUs (measured or not), all runs and the methodology.",
        "responses": {
          "200": {
            "description": "The catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          }
        }
      }
    },
    "/api/measurements": {
      "get": {
        "operationId": "queryMeasurements",
        "summary": "The catalog filtered by exact GPU id and/or exact model tag",
        "description": "Both filters are optional and exact (case-sensitive, no partial matches). Status measured means runs holds the matching observations. Status untested (HTTP 200) means the catalog has no run for the request; it is not an estimate and says nothing about speed. Status unknown-gpu (HTTP 404) means gpuId is not a GPU in the catalog.",
        "parameters": [
          {
            "name": "gpuId",
            "in": "query",
            "required": false,
            "description": "Exact GPU id from the catalog, for example rtx-3080-10gb.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,63}$",
              "maxLength": 64
            },
            "example": "rtx-3080-10gb"
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Exact Ollama model tag, for example gemma4:26b.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$",
              "maxLength": 128
            },
            "example": "gemma4:26b"
          }
        ],
        "responses": {
          "200": {
            "description": "Status measured or untested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResult"
                }
              }
            }
          },
          "400": {
            "description": "Unknown or repeated parameter, or a value that is not an exact id or tag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "gpuId is not a GPU in the catalog (status unknown-gpu).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResult"
                }
              }
            }
          },
          "405": {
            "description": "Only GET, HEAD and OPTIONS are supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The catalog could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Gpu": {
        "type": "object",
        "required": [
          "id",
          "name",
          "vramGiB",
          "measured"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "vramGiB": {
            "type": "number"
          },
          "measured": {
            "type": "boolean",
            "description": "False means the GPU is listed for comparison only and has no runs."
          }
        }
      },
      "Run": {
        "type": "object",
        "required": [
          "tag",
          "gpuId",
          "quantization",
          "thinking",
          "generationTokensPerSecond",
          "peakGpuDeltaMiB",
          "loadSeconds",
          "contextTokens"
        ],
        "properties": {
          "tag": {
            "type": "string",
            "description": "Exact Ollama model tag used."
          },
          "gpuId": {
            "type": "string"
          },
          "quantization": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the tag does not identify the weight format; it is not guessed."
          },
          "thinking": {
            "type": "string",
            "enum": [
              "off",
              "low"
            ]
          },
          "generationTokensPerSecond": {
            "type": "integer",
            "description": "Median generation throughput over calls producing at least 30 tokens, rounded to whole tokens per second."
          },
          "peakGpuDeltaMiB": {
            "type": "integer",
            "description": "Incremental peak GPU memory seen by nvidia-smi on a shared machine. Not total memory in use, not a minimum VRAM requirement."
          },
          "loadSeconds": {
            "type": "integer",
            "description": "Cold load from disk, whole seconds."
          },
          "contextTokens": {
            "type": "integer"
          }
        }
      },
      "Methodology": {
        "type": "object",
        "required": [
          "published",
          "runtime",
          "description",
          "limitations"
        ],
        "properties": {
          "published": {
            "type": "string"
          },
          "runtime": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Catalog": {
        "type": "object",
        "required": [
          "version",
          "gpus",
          "runs",
          "methodology"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "gpus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Gpu"
            }
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Run"
            }
          },
          "methodology": {
            "$ref": "#/components/schemas/Methodology"
          }
        }
      },
      "QueryResult": {
        "type": "object",
        "required": [
          "status",
          "query",
          "gpus",
          "runs",
          "dataset",
          "methodology",
          "notice"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "measured",
              "untested",
              "unknown-gpu"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "gpu-untested",
              "no-run-for-tag-on-gpu",
              "tag-not-in-dataset",
              "no-runs-in-dataset",
              "gpu-not-in-dataset"
            ],
            "description": "Present unless status is measured."
          },
          "query": {
            "type": "object",
            "required": [
              "gpuId",
              "tag"
            ],
            "properties": {
              "gpuId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tag": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "gpus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Gpu"
            },
            "description": "The requested GPU, or every GPU when gpuId is omitted; empty for unknown-gpu."
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Run"
            }
          },
          "knownGpuIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only with status unknown-gpu."
          },
          "dataset": {
            "type": "object",
            "required": [
              "version",
              "published",
              "runtime",
              "url"
            ],
            "properties": {
              "version": {
                "type": "integer"
              },
              "published": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "runtime": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "methodology": {
            "$ref": "#/components/schemas/Methodology"
          },
          "notice": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
