Skip to content

Commit

Permalink
nits and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dglogo committed May 28, 2024
1 parent aecdf0f commit 540d24c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions libs/ai-endpoints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ When ready to deploy, you can self-host models with NVIDIA NIM—which is includ
```python
from langchain_nvidia_ai_endpoints import ChatNVIDIA, NVIDIAEmbeddings, NVIDIARerank

# connect to an chat NIM running at localhost:8000
llm = ChatNVIDIA(base_url="http://localhost:8000/v1")
# connect to an chat NIM running at localhost:8000, specifying a specific model
llm = ChatNVIDIA(base_url="http://localhost:8000/v1", model="meta-llama3-8b-instruct")

# connect to an embedding NIM running at localhost:2016
embedder = NVIDIAEmbeddings(base_url="http://localhost:2016/v1")
# connect to an embedding NIM running at localhost:8080
embedder = NVIDIAEmbeddings(base_url="http://localhost:8080/v1")

# connect to a reranking NIM running at localhost:1976
ranker = NVIDIARerank(base_url="http://localhost:1976/v1")
# connect to a reranking NIM running at localhost:2016
ranker = NVIDIARerank(base_url="http://localhost:2016/v1")
```

## Stream, Batch, and Async
Expand Down
6 changes: 3 additions & 3 deletions libs/ai-endpoints/docs/chat/nvidia_ai_endpoints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"NIMs are packaged as container images on a per model basis and are distributed as NGC container images through the NVIDIA NGC Catalog. \n",
"At their core, NIMs provide easy, consistent, and familiar APIs for running inference on an AI model.\n",
"\n",
"This example goes over how to use LangChain to interact with the supported [NVIDIA Retrieval QA Embedding Model](https://build.nvidia.com/nvidia/embed-qa-4) for [retrieval-augmented generation](https://developer.nvidia.com/blog/build-enterprise-retrieval-augmented-generation-apps-with-nvidia-retrieval-qa-embedding-model/) via the `NVIDIAEmbeddings` class.\n",
"This example goes over how to use LangChain to interact with NVIDIA supported via the `ChatNVIDIA` class.\n",
"\n",
"For more information on accessing the chat models through this api, check out the [ChatNVIDIA](https://python.langchain.com/docs/integrations/chat/nvidia_ai_endpoints/) documentation."
]
Expand Down Expand Up @@ -133,8 +133,8 @@
"source": [
"from langchain_nvidia_ai_endpoints import ChatNVIDIA\n",
"\n",
"# connect to an embedding NIM running at localhost:8000\n",
"llm = ChatNVIDIA(base_url=\"http://localhost:8000/v1\")"
"# connect to an embedding NIM running at localhost:8000, specifying a specific model\n",
"llm = ChatNVIDIA(base_url=\"http://localhost:8000/v1\", model=\"meta-llama3-8b-instruct\")"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions libs/ai-endpoints/docs/providers/nvidia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ When ready to deploy, you can self-host models with NVIDIA NIM—which is includ
```python
from langchain_nvidia_ai_endpoints import ChatNVIDIA, NVIDIAEmbeddings, NVIDIARerank

# connect to an chat NIM running at localhost:8000
llm = ChatNVIDIA(base_url="http://localhost:8000/v1")
# connect to an chat NIM running at localhost:8000, specifyig a specific model
llm = ChatNVIDIA(base_url="http://localhost:8000/v1", model="meta-llama3-8b-instruct")

# connect to an embedding NIM running at localhost:2016
embedder = NVIDIAEmbeddings(base_url="http://localhost:2016/v1")
# connect to an embedding NIM running at localhost:8080
embedder = NVIDIAEmbeddings(base_url="http://localhost:8080/v1")

# connect to a reranking NIM running at localhost:1976
ranker = NVIDIARerank(base_url="http://localhost:1976/v1")
# connect to a reranking NIM running at localhost:2016
ranker = NVIDIARerank(base_url="http://localhost:2016/v1")
```

## Using NVIDIA AI Foundation Endpoints
Expand Down
8 changes: 4 additions & 4 deletions libs/ai-endpoints/docs/retrievers/nvidia_rerank.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@
"source": [
"from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings, NVIDIARerank\n",
"\n",
"# connect to an embedding NIM running at localhost:2016\n",
"embedder = NVIDIAEmbeddings(base_url=\"http://localhost:2016/v1\")\n",
"# connect to an embedding NIM running at localhost:8080\n",
"embedder = NVIDIAEmbeddings(base_url=\"http://localhost:8080/v1\")\n",
"\n",
"# connect to a reranking NIM running at localhost:1976\n",
"ranker = NVIDIARerank(base_url=\"http://localhost:1976/v1\")"
"# connect to a reranking NIM running at localhost:2016\n",
"reranker = NVIDIARerank(base_url=\"http://localhost:2016/v1\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
"source": [
"from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings\n",
"\n",
"# connect to an embedding NIM running at localhost:2016\n",
"embedder = NVIDIAEmbeddings(base_url=\"http://localhost:2016/v1\")"
"# connect to an embedding NIM running at localhost:8080\n",
"embedder = NVIDIAEmbeddings(base_url=\"http://localhost:8080/v1\")"
]
},
{
Expand Down Expand Up @@ -437,7 +437,7 @@
"source": [
"vectorstore = FAISS.from_texts(\n",
" [\"harrison worked at kensho\"],\n",
" embedding=NVIDIAEmbeddings(model=\"ai-embed-qa-4\"),\n",
" embedding=NVIDIAEmbeddings(model=\"NV-Embed-QA\"),\n",
")\n",
"retriever = vectorstore.as_retriever()\n",
"\n",
Expand Down

0 comments on commit 540d24c

Please sign in to comment.