def friendli_modelname_to_contextsize(modelname: str) -> int:
    """
    Get a context size of a model from its name.

    Args:
        modelname (str): The name of model.

    Returns:
        int: Context size of the model.

    """
    context_size = ALL_AVAILABLE_MODELS.get(modelname)
    if context_size is None:
        raise ValueError(
            f"Unknown model: {modelname}. Please provide a valid Friendli model name."
            "Known models are: " + ", ".join(ALL_AVAILABLE_MODELS.keys())
        )

    return context_size

    Get a context size of a model from its name.

    Args:
        modelname (str): The name of model.

    Returns:
        int: Context size of the model.

    
llama-index-integrations/llms/llama-index-llms-friendli/llama_index/llms/friendli/utils.py