Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions notdiamond/llms/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import inspect
import logging
import time
import warnings
from enum import Enum
from typing import (
Any,
Expand Down Expand Up @@ -121,6 +122,14 @@ def __init__(
"Invalid tradeoff. Accepted values: cost, latency."
)

if tradeoff is not None:
warnings.warn(
"The tradeoff constructor parameter is deprecated and will be removed in a "
"future version. Please specify the tradeoff when using model_select or invocation methods.",
DeprecationWarning,
stacklevel=2,
)

super().__init__(
api_key=api_key,
llm_configs=llm_configs,
Expand Down Expand Up @@ -573,6 +582,14 @@ def __init__(
if user_agent is None:
user_agent = settings.DEFAULT_USER_AGENT

if tradeoff is not None:
warnings.warn(
"The tradeoff constructor parameter is deprecated and will be removed in a "
"future version. Please specify the tradeoff when using model_select or invocation methods.",
DeprecationWarning,
stacklevel=2,
)

self.user_agent = user_agent
assert (
self.api_key is not None
Expand Down Expand Up @@ -1679,6 +1696,9 @@ class NotDiamond(_NDClient):

tradeoff: Optional[str]
"""
[DEPRECATED] The tradeoff constructor parameter is deprecated and will be removed in a future version.
Please specify the tradeoff when using model_select or invocation methods.

Define tradeoff between "cost" and "latency" for the router to determine the best LLM for a given query.
If None is specified, then the router will not consider either cost or latency.

Expand Down Expand Up @@ -1713,6 +1733,14 @@ def __init__(
)
self.nd_api_url = nd_api_url

if kwargs.get("tradeoff") is not None:
warnings.warn(
"The tradeoff constructor parameter is deprecated and will be removed in a "
"future version. Please specify the tradeoff when using model_select or invocation methods.",
DeprecationWarning,
stacklevel=2,
)


def _get_accepted_invoke_errors(provider: str) -> Tuple:
if provider == "google":
Expand Down