Register a model as a known model.
Must be done at the beginning of a program, at least before the model is used or available models are listed.
For instance:
from langchain_nvidia_ai_endpoints import register_model, Model
register_model(
Model(
id="my-custom-model-name",
model_type="chat",
client="ChatNVIDIA",
endpoint="http://host:port/path-to-my-model"
)
)
llm = ChatNVIDIA(model="my-custom-model-name")
Be sure that the id matches the model parameter the endpoint expects.
Supported model types are chat models, which must accept and produce chat completion payloads.
Supported model clients are ChatNVIDIA, for chat models.
Endpoint is required.
Use this instead of passing base_url to a client constructor when the model's
endpoint supports inference and not /v1/models listing.
Use base_url when the model's endpoint supports /v1/models listing and inference
on a known path, e.g. /v1/chat/completions.
register_model(
model: Model,
) -> None