diff --git a/llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/base.py b/llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/base.py index 31d79209cb311..7dd8a7f43bc06 100644 --- a/llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/base.py +++ b/llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/base.py @@ -136,13 +136,16 @@ def metadata(self) -> LLMMetadata: ) def _get_context_window(self) -> int: + # Check https://docs.perplexity.ai/docs/model-cards for latest model information model_context_windows = { - "sonar-small-chat": 16384, - "sonar-small-online": 12000, - "sonar-medium-chat": 16384, - "sonar-medium-online": 12000, - "codellama-34b-instruct": 16384, - "mistral-7b-instruct": 16384, + # Perplexity Models + "llama-3-sonar-small-32k-chat": 32768, + "llama-3-sonar-small-32k-online": 28000, + "llama-3-sonar-large-32k-chat": 32768, + "llama-3-sonar-large-32k-online": 28000, + # Open Source Models + "llama-3-8b-instruct": 8192, + "llama-3-70b-instruct": 8192, "mixtral-8x7b-instruct": 16384, } return model_context_windows.get( @@ -150,12 +153,16 @@ def _get_context_window(self) -> int: ) # Default to 4096 if model not found def _is_chat_model(self) -> bool: + # Check https://docs.perplexity.ai/docs/model-cards for latest model information chat_models = { - "sonar-small-chat", - "sonar-small-online", - "sonar-medium-chat", - "sonar-medium-online" "codellama-34b-instruct", - "mistral-7b-instruct", + # Perplexity Models + "llama-3-sonar-small-32k-chat", + "llama-3-sonar-small-32k-online", + "llama-3-sonar-large-32k-chat", + "llama-3-sonar-large-32k-online", + # Open Source Models + "llama-3-8b-instruct", + "llama-3-70b-instruct", "mixtral-8x7b-instruct", } return self.model in chat_models diff --git a/llama-index-integrations/llms/llama-index-llms-perplexity/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-perplexity/pyproject.toml index 824d8a13122e1..07d0098d66307 100644 --- a/llama-index-integrations/llms/llama-index-llms-perplexity/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-perplexity/pyproject.toml @@ -27,7 +27,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-llms-perplexity" readme = "README.md" -version = "0.1.3" +version = "0.1.4" [tool.poetry.dependencies] python = ">=3.8.1,<4.0"