Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiteLLM error message #1619

Open
fullstackwebdev opened this issue Oct 13, 2024 · 0 comments
Open

LiteLLM error message #1619

fullstackwebdev opened this issue Oct 13, 2024 · 0 comments

Comments

@fullstackwebdev
Copy link

using the litellm openai adapter to override base url and simply connecting creates a large dump of LiteLLM error messages, rendering the terminal useless on large programs

  1. setup an open ai compatible endpoint
  2. set your API_BASE point
  3. use the 'openai/MODELNAME' syntax

simple app

PORT = os.getenv('PORT', 6002)
API_BASE = f"http://localhost:{PORT}/v1/"
MODEL_NAME = "openai/unsloth/gemma-2-27b-it-bnb-4bit"
logging.getLogger("dspy").setLevel(logging.ERROR) # doesn't work
logging.getLogger("dspy").propagate = False # doesn't work 

lm = dspy.LM(MODEL_NAME, api_key="..", api_base=API_BASE)
dspy.configure(lm=lm)

lm("What is 2+2?", temperature=0.9)

output

Provider List: https://docs.litellm.ai/docs/providers

['2 + 2 = 4']

Provider List: https://docs.litellm.ai/docs/providers


Provider List: https://docs.litellm.ai/docs/providers


Provider List: https://docs.litellm.ai/docs/providers

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant