litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Bug]: moderation endpoint is broken

Open Clad3815 opened this issue 1 year ago • 2 comments

What happened?

When using the moderation from openai, littlellm seem to send the prefix "openai/" to the openai api

	const response = await openai.moderations.create({
		input: text,
		// model: "omni-moderation-latest"
		model: "text-moderation-latest"
	});

Relevant log output

litellm-1  | INFO:     172.30.0.1:43458 - "POST /v1/moderations HTTP/1.1" 400 Bad Request
litellm-1  | 17:05:41 - LiteLLM Proxy:ERROR: proxy_server.py:5442 - litellm.proxy.proxy_server.moderations(): Exception occured - Error code: 400 - {'error': {'message': "Invalid value for 'model' = openai/text-moderation-latest. Please check the OpenAI documentation and try again.", 'type': 'invalid_request_error', 'param': 'model', 'code': None}

Twitter / LinkedIn details

No response

Clad3815 avatar Oct 02 '24 17:10 Clad3815

const response = await openai.moderations.create({ input: text, // model: "omni-moderation-latest" model: "text-moderation-latest" });

can i see how you set this up on your config? would help to repro

krrishdholakia avatar Oct 02 '24 23:10 krrishdholakia

I'm using the Docker version, and here is my config:


  - model_name: omni-moderation-latest
    litellm_params:
      model: openai/omni-moderation-latest
 
  - model_name: text-moderation-stable
    litellm_params:
      model: openai/text-moderation-stable

  - model_name: text-moderation-latest
    litellm_params:
      model: openai/text-moderation-latest
      
      

Clad3815 avatar Oct 03 '24 06:10 Clad3815

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jan 28 '25 02:01 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Apr 29 '25 00:04 github-actions[bot]