{

"title": "RubyLLM Models Schema",
"description": "Schema for validating the structure of models.json",
"type": "array",
"items": {
  "type": "object",
  "required": ["id", "name", "provider", "context_window", "max_output_tokens"],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the model"
    },
    "name": {
      "type": "string",
      "description": "Display name of the model"
    },
    "provider": {
      "type": "string",
      "description": "Provider of the model (e.g., openai, anthropic, mistral)"
    },
    "family": {
      "type": ["string", "null"],
      "description": "Model family (e.g., gpt-4, claude-3)"
    },
    "created_at": {
      "type": ["null", {"type": "string", "format": "date-time"}],
      "description": "Creation date of the model"
    },
    "context_window": {
      "type": ["null", {"type": "integer", "minimum": 0}],
      "description": "Maximum context window size"
    },
    "max_output_tokens": {
      "type": ["null", {"type": "integer", "minimum": 0}],
      "description": "Maximum output tokens"
    },
    "knowledge_cutoff": {
      "type": ["null", {"type": "string", "format": "date"}],
      "description": "Knowledge cutoff date"
    },
    "modalities": {
      "type": "object",
      "required": ["input", "output"],
      "properties": {
        "input": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["text", "image", "audio", "pdf", "video", "file"]
          },
          "uniqueItems": true,
          "description": "Supported input modalities"
        },
        "output": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["text", "image", "audio", "video", "embeddings", "moderation"]
          },
          "uniqueItems": true,
          "description": "Supported output modalities"
        }
      }
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "streaming", "function_calling", "structured_output", "predicted_outputs",
          "distillation", "fine_tuning", "batch", "realtime", "image_generation",
          "speech_generation", "transcription", "translation", "citations", "reasoning",
          "caching", "moderation", "json_mode", "vision"
        ]
      },
      "uniqueItems": true,
      "description": "Model capabilities"
    },
    "pricing": {
      "type": "object",
      "properties": {
        "text_tokens": {
          "type": "object",
          "required": ["standard"],
          "properties": {
            "standard": {
              "type": "object",
              "properties": {
                "input_per_million": {"type": "number", "minimum": 0},
                "cache_read_input_per_million": {"type": "number", "minimum": 0},
                "cache_write_input_per_million": {"type": "number", "minimum": 0},
                "cached_input_per_million": {"type": "number", "minimum": 0},
                "cache_creation_input_per_million": {"type": "number", "minimum": 0},
                "output_per_million": {"type": "number", "minimum": 0},
                "reasoning_output_per_million": {"type": "number", "minimum": 0}
              }
            },
            "batch": {
              "type": "object",
              "properties": {
                "input_per_million": {"type": "number", "minimum": 0},
                "output_per_million": {"type": "number", "minimum": 0}
              }
            }
          }
        },
        "images": {
          "type": "object",
          "properties": {
            "standard": {
              "type": "object",
              "properties": {
                "input": {"type": "number", "minimum": 0},
                "output": {"type": "number", "minimum": 0}
              }
            },
            "batch": {
              "type": "object",
              "properties": {
                "input": {"type": "number", "minimum": 0},
                "output": {"type": "number", "minimum": 0}
              }
            }
          }
        },
        "audio_tokens": {
          "type": "object",
          "properties": {
            "standard": {
              "type": "object",
              "properties": {
                "input_per_million": {"type": "number", "minimum": 0},
                "output_per_million": {"type": "number", "minimum": 0}
              }
            },
            "batch": {
              "type": "object",
              "properties": {
                "input_per_million": {"type": "number", "minimum": 0},
                "output_per_million": {"type": "number", "minimum": 0}
              }
            }
          }
        },
        "embeddings": {
          "type": "object",
          "properties": {
            "standard": {
              "type": "object",
              "properties": {
                "input_per_million": {"type": "number", "minimum": 0}
              }
            },
            "batch": {
              "type": "object",
              "properties": {
                "input_per_million": {"type": "number", "minimum": 0}
              }
            }
          }
        }
      },
      "description": "Pricing information for the model"
    },
    "metadata": {
      "type": "object",
      "description": "Additional metadata about the model"
    }
  }
}

}