// Provider-wire compat for "zhipu-coding-plan"; regenerated from the frozen census using deployment contract selectors.

provider "zhipu-coding-plan" {
	default-model "glm-5.1"
	env "ZHIPU_API_KEY"
	dynamic-models-authoritative #true
	discovery label="Zhipu Coding Plan"
	// The coding-plan upstream snapshot omits FlashX although the served SKU
	// has the same limits and mandatory-thinking ladder as GLM-5.3-Flash.
	seed api="openai-completions" base-url="https://open.bigmodel.cn/api/coding/paas/v4" bundle="always" {
		model "glm-5.3-flashx" name="GLM-5.3-FlashX" {
			reasoning #true
			input "text" "image"
			cost input=0 output=0 cache-read=0 cache-write=0
			limits context=1000000 max-tokens=131072
		}
	}

	// Replaces the Zhipu provider thinking-format branch.
	thinking-format "zai"
	class "glm" {
		thinking-mode "effort"
		// Vision family and flash >=5.3 accept image input; the /models
		// listing carries no modality metadata.
		family "vision" {
			input-modalities "text" "image"
		}
		family "flash" {
			revision ">=5.3" {
				input-modalities "text" "image"
			}
		}
		family "turbo" {
			reasoning-content-field "reasoning_content"
			supports-developer-role #false
			thinking-efforts "minimal" "low" "medium" "high"
			thinking-format "zai"
		}
	}
	// residue: taxonomy ranks and exact globs do not isolate these models.
	models "*5" "glm-4.6" {
		thinking-efforts "minimal" "low" "medium" "high"
	}
	// residue: taxonomy ranks and exact globs do not isolate these models.
	models "glm-4.5-air" {
		reasoning-content-field "reasoning_content"
		supports-developer-role #false
		thinking-format "zai"
	}
	// residue: taxonomy ranks and exact globs do not isolate these models.
	models "glm-4.6v" "glm-4.7" "glm-5.1" {
		reasoning-content-field "reasoning_content"
		supports-developer-role #false
		thinking-efforts "minimal" "low" "medium" "high"
		thinking-format "zai"
	}
	// residue: taxonomy ranks and exact globs do not isolate these models.
	models "glm-5.2*" {
		reasoning-content-field "reasoning_content"
		supports-developer-role #false
		thinking-efforts "high" "max"
		thinking-format "zai"
	}
}
