diff --git a/README.md b/README.md index 2db98c244..6f8638556 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ in JupyterLab and the Jupyter Notebook. More specifically, Jupyter AI offers: This works anywhere the IPython kernel runs (JupyterLab, Jupyter Notebook, Google Colab, VSCode, etc.). * A native chat UI in JupyterLab that enables you to work with generative AI as a conversational assistant. * Support for a wide range of generative model providers, including AI21, Anthropic, AWS, Cohere, - Hugging Face, and OpenAI. + Hugging Face, NVIDIA, and OpenAI. * Local model support through GPT4All, enabling use of generative AI models on consumer grade machines with ease and privacy. diff --git a/docs/source/index.md b/docs/source/index.md index 28d094e93..8d70538e3 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -8,7 +8,7 @@ in JupyterLab and the Jupyter Notebook. More specifically, Jupyter AI offers: This works anywhere the IPython kernel runs (JupyterLab, Jupyter Notebook, Google Colab, VSCode, etc.). * A native chat UI in JupyterLab that enables you to work with generative AI as a conversational assistant. * Support for a wide range of generative model providers and models - (AI21, Anthropic, Cohere, Hugging Face, OpenAI, SageMaker, etc.). + (AI21, Anthropic, Cohere, Hugging Face, OpenAI, SageMaker, NVIDIA, etc.). A screenshot of Jupyter AI showing the chat interface and the magic commands [AI Foundation Models](https://catalog.ngc.nvidia.com/ai-foundation-models), and select a model with an API endpoint. Click "API" on the model's detail page, and click "Generate Key". Save this key, and set it as the environment variable `NVIDIA_API_KEY` to access any of the model endpoints. + SageMaker endpoint names are created when you deploy a model. For more information, see ["Create your endpoint and deploy your model"](https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints-deployment.html) in the SageMaker documentation. @@ -515,6 +518,7 @@ We currently support the following language model providers: - `bedrock-chat` - `cohere` - `huggingface_hub` +- `nvidia-chat` - `openai` - `openai-chat` - `sagemaker-endpoint` diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/__init__.py b/packages/jupyter-ai-magics/jupyter_ai_magics/__init__.py index a00d4877c..176e30ada 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/__init__.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/__init__.py @@ -22,6 +22,7 @@ BedrockChatProvider, BedrockProvider, ChatAnthropicProvider, + ChatNVIDIAProvider, ChatOpenAIProvider, CohereProvider, GPT4AllProvider, diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py index 3f3712ad7..ff309881e 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py @@ -38,6 +38,7 @@ OpenAI, SagemakerEndpoint, ) +from langchain_nvidia_ai_endpoints import ChatNVIDIA # this is necessary because `langchain.pydantic_v1.main` does not include # `ModelMetaclass`, as it is not listed in `__all__` by the `pydantic.main` @@ -809,3 +810,23 @@ class QianfanProvider(BaseProvider, QianfanChatEndpoint): model_id_key = "model_name" pypi_package_deps = ["qianfan"] auth_strategy = MultiEnvAuthStrategy(names=["QIANFAN_AK", "QIANFAN_SK"]) + + +class ChatNVIDIAProvider(BaseProvider, ChatNVIDIA): + id = "nvidia-chat" + name = "NVIDIA" + models = [ + "playground_llama2_70b", + "playground_nemotron_steerlm_8b", + "playground_mistral_7b", + "playground_nv_llama2_rlhf_70b", + "playground_llama2_13b", + "playground_steerlm_llama_70b", + "playground_llama2_code_13b", + "playground_yi_34b", + "playground_mixtral_8x7b", + "playground_neva_22b", + "playground_llama2_code_34b", + ] + model_id_key = "model" + auth_strategy = EnvAuthStrategy(name="NVIDIA_API_KEY") diff --git a/packages/jupyter-ai-magics/pyproject.toml b/packages/jupyter-ai-magics/pyproject.toml index c57511791..138b79ee3 100644 --- a/packages/jupyter-ai-magics/pyproject.toml +++ b/packages/jupyter-ai-magics/pyproject.toml @@ -41,6 +41,7 @@ all = [ "gpt4all", "huggingface_hub", "ipywidgets", + "langchain_nvidia_ai_endpoints", "pillow", "openai~=1.6.1", "boto3", @@ -61,6 +62,7 @@ amazon-bedrock = "jupyter_ai_magics:BedrockProvider" anthropic-chat = "jupyter_ai_magics:ChatAnthropicProvider" amazon-bedrock-chat = "jupyter_ai_magics:BedrockChatProvider" qianfan = "jupyter_ai_magics:QianfanProvider" +nvidia-chat = "jupyter_ai_magics:ChatNVIDIAProvider" [project.entry-points."jupyter_ai.embeddings_model_providers"] bedrock = "jupyter_ai_magics:BedrockEmbeddingsProvider"