Replies: 1 comment
-
To resolve the 404 error indicating an unknown model when using the from langchain_nvidia_ai_endpoints import NVIDIARerank
# connect to a reranking NIM running at localhost:2016
ranker = NVIDIARerank(base_url="http://localhost:2016/v1", model="nv-rerankqa-mistral-4b-v3") Make sure that the model name Additionally, ensure that you have set up your NVIDIA API key correctly. Follow these steps to set up your API key:
You can set the API key in your environment as follows: import getpass
import os
if os.environ.get("NVIDIA_API_KEY", "").startswith("nvapi-"):
print("Valid NVIDIA_API_KEY already in environment. Delete to reset")
else:
nvapi_key = getpass.getpass("NVAPI Key (starts with nvapi-): ")
assert nvapi_key.startswith("nvapi-"), f"{nvapi_key[:5]}... is not a valid key"
os.environ["NVIDIA_API_KEY"] = nvapi_key By ensuring the correct model name, base URL, and API key setup, you should be able to resolve the 404 error [1][2]. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I have deployed nv-rerankqa-mistral-4b-v3:1.0.1 model using helm chart available in NGC Catalog. Deployment has been successful. I am able to query model using curl successfully however getting error with langchain NVIDIARerank APIs
System Info
python -m langchain_core.sys_info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
Beta Was this translation helpful? Give feedback.
All reactions