def model_must_be_deployed(client: Elasticsearch, model_id: str) -> None:
    """
    :raises [NotFoundError]: if the model is neither downloaded nor deployed.
    :raises [ConflictError]: if the model is downloaded but not yet deployed.
    """
    doc = {"text_field": f"test if the model '{model_id}' is deployed"}
    try:
        client.ml.infer_trained_model(model_id=model_id, docs=[doc])
    except BadRequestError:
        # The model is deployed but expects a different input field name.
        pass

    :raises [NotFoundError]: if the model is neither downloaded nor deployed.
    :raises [ConflictError]: if the model is downloaded but not yet deployed.
    
elasticsearch/helpers/vectorstore/_sync/_utils.py