diff --git a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md index 89050991e..f185654da 100644 --- a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md +++ b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md @@ -3,20 +3,35 @@ ## Supported models Vizro-AI currently supports [OpenAI models](https://platform.openai.com/docs/models) as follows, although we are working on supporting more vendors: -- `gpt-3.5-turbo` (default model) -- `gpt-4-turbo` (recommended for best model performance) -- `gpt-3.5-turbo-0125` -- `gpt-3.5-turbo-1106` -- `gpt-4-0613` -- `gpt-4-1106-preview` -- `gpt-3.5-turbo-0613` (to be deprecated on June 13, 2024) +=== "OpenAI" + + - gpt-3.5-turbo `default` + - gpt-4-turbo + - gpt-4o + - gpt-4 + - gpt-4-0613 + - gpt-4-1106-preview + - gpt-4-turbo-2024-04-09 + - gpt-4-turbo-preview + - gpt-4-0125-preview + - gpt-3.5-turbo-1106 + - gpt-3.5-turbo-0125 + - gpt-4o-2024-05-13 + +=== "Anthropic" + + :octicons-hourglass-24: In development + +=== "MistralAI" + + :octicons-hourglass-24: In development These models offer different levels of performance and cost to Vizro-AI users: -* The **gpt-3.5** model series have lower price point and higher speeds for providing answers, but do not offer sophisticated charting. +* The **gpt-3.5** model series have lower price points and fast speeds for providing answers, but do not offer sophisticated charting. -* Consider upgrading to the **gpt-4** models for more demanding tasks. While they are part of a more capable GPT model series, their response time is slower than gpt-3.5 models, and they come at a higher cost. +* Consider upgrading to the **gpt-4** and **gpt-4o** model series for more demanding tasks. While they are part of a more capable GPT model series, they come at a higher cost. Refer to the [OpenAI documentation for more about model capabilities](https://platform.openai.com/docs/models/overview) and [pricing](https://openai.com/pricing). @@ -36,10 +51,10 @@ The example below uses the OpenAI model name in a string form: ```py linenums="1" from vizro_ai import VizroAI - vizro_ai = VizroAI(model="gpt-3.5-turbo-0125") + vizro_ai = VizroAI(model="gpt-4-turbo") ``` -The example below customizes the `ChatOpenAI` instance further beyond the chosen default from the string instantiation. We pass the `"gpt-3.5-turbo-0125"` model from OpenAI as `model_name` for `ChatOpenAI`, which offers improved response accuracy, we also want to increase maximum number of retries. +The example below customizes the `ChatOpenAI` instance further beyond the chosen default from the string instantiation. We pass the `"gpt-4-turbo"` model from OpenAI as `model_name` for `ChatOpenAI`, which offers improved response accuracy, we also want to increase maximum number of retries. It's important to mention that any parameter that could be used in the `openai.create` call is also usable in `ChatOpenAI`. For more customization options for `ChatOpenAI`, refer to the [LangChain ChatOpenAI docs](https://api.python.langchain.com/en/latest/chat_models/langchain_openai.chat_models.base.ChatOpenAI.html) @@ -57,7 +72,7 @@ To ensure a deterministic answer to our queries, we've set the temperature to 0. df = px.data.gapminder() llm = ChatOpenAI( - model_name="gpt-3.5-turbo-0125", + model_name="gpt-4-turbo", temperature=0, max_retries=5, ) diff --git a/vizro-ai/src/vizro_ai/chains/_llm_models.py b/vizro-ai/src/vizro_ai/chains/_llm_models.py index b8f4b929f..9014ad17c 100644 --- a/vizro-ai/src/vizro_ai/chains/_llm_models.py +++ b/vizro-ai/src/vizro_ai/chains/_llm_models.py @@ -6,11 +6,16 @@ SUPPORTED_MODELS = { "OpenAI": [ "gpt-4-0613", - "gpt-3.5-turbo-1106", + "gpt-4", "gpt-4-1106-preview", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-turbo-preview", + "gpt-4-0125-preview", + "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo", - "gpt-4-turbo", + "gpt-4o-2024-05-13", "gpt-4o", ] } @@ -47,7 +52,7 @@ def _get_llm_model(model: Optional[Union[ChatOpenAI, str]] = None) -> BaseChatMo return DEFAULT_WRAPPER_MAP.get(vendor)(model_name=model, temperature=DEFAULT_TEMPERATURE) raise ValueError( - f"Model {model} not found! List of available model can be found at https://vizro.readthedocs.io/projects/vizro-ai/en/latest/pages/explanation/faq/#which-llms-are-supported-by-vizro-ai" + f"Model {model} not found! List of available model can be found at https://vizro.readthedocs.io/projects/vizro-ai/en/latest/pages/user-guides/customize-vizro-ai/#supported-models" )