-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Bug]: Using Mistral model through Azure Endpoint #2828
Comments
@mpalaourg -- do you still have this bug? @marklysze might have helpful suggestions per his experience with using different models. |
@mpalaourg, if you are still having this issue, can you please provide your joker_agent's config (without keys). This issue relates to the order of roles in the messages which need to be adjusted for Mistral (and other non-OpenAI inference). If it's still an issue a possibility is updating the Mistral client class to support a connection to Azure's serverless endpoints. |
The conversation is probably something picked from the cache. The problem probably lies in the deployment of the LLM on Azure's endpoints. I tried with Meta-Llama-3-70B-Instruct model deployment over Azure serverless endpoint with the following config and get an "openai.NotFoundError: NOT FOUND" error. { The code works fine with a regular Azure Open AI config |
Same problem using LiteLLM + Here is a curl -X POST \
https://api.mistral.ai/v1/chat/completions \
-H 'Authorization: Bearer <the-api-they>' \
-H 'Content-Type: application/json' \
-d '{
"model": "mistral-large-latest",
"messages": [
{
"content": "You are a GitLab assistant: your purpose is to help users discuss a specific GitLab issue.",
"role": "system"
},
{
"content": "Please handle the following todo: GitLab instance URL: https://gitlab.com/api/v4\n\n Todo ID: 493871141\n Todo action: directly_addressed\n Todo state: pending\n Todo target ID: 25\n Todo target type: Issue\n Todo target URL: https://gitlab.com/lx-industries/wally-the-wobot/tests/repl-tests/-/issues/25#note_2296444245\n\n Project ID: 45010942\n Project name: LX Industries / Wally The Wobot / tests / REPL Tests\n Project path: lx-industries/wally-the-wobot/tests/repl-tests\n Project default branch: main\n Project description: \n",
"role": "user"
},
{
"content": "Please reply to the user.",
"role": "user"
},
{
"tool_calls": [
{
"id": "iRvM4muS4",
"function": {
"arguments": "{\"todo_id\": 493871141, \"project_id\": 45010942, \"target_url\": \"https://gitlab.com/lx-industries/wally-the-wobot/tests/repl-tests/-/issues/25#note_2296444245\", \"target_type\": \"Issue\", \"target_id\": 25}",
"name": "get_todo_discussion_id"
},
"type": "function"
}
],
"role": "assistant"
},
{
"content": "e7764e059fad9a55ff30dbd4b2bf108b5205e486",
"role": "tool",
"tool_call_id": "iRvM4muS4"
},
{
"content": "[{\"name\": \"list_issue_notes\", \"arguments\": {\"project_id\": 45010942, \"issue_iid\": 25, \"discussion_id\": \"e7764e059fad9a55ff30dbd4b2bf108b5205e486\"}}]",
"role": "assistant"
}
]
}' I get the following error:
With the relevant message being How I run LiteLLM:
---
services:
litellm:
image: ghcr.io/berriai/litellm:main-v1.58.1@sha256:0bd93bb9062e4cb004c8f85c5eb8bf0469f1830f8c888f0f1b1f196d2747774e
volumes:
- ./config.yml:/app/config.yml:ro
ports:
- 4000:4000
command: ["--config", "/app/config.yml", --detailed_debug]
---
model_list:
- model_name: mistral-large-latest
litellm_params:
model: mistral/mistral-large-latest
api_base: https://api.mistral.ai/v1/
api_key: the-api-key
model_info:
id: mistral-large-latest
max_tokens: 131072
litellm_settings:
drop_params: true
general_settings: Then, in my app: model_client = OpenAIChatCompletionClient(
model="mistral-large-latest",
api_key="notneeded",
base_url="http://0.0.0.0:4000",
model_capabilities={
"json_output": False,
"vision": False,
"function_calling": True,
},
) Update: the problem does not exist with the OpenAI API (https://api.openai.com/v1/chat/completions with model = gpt-4o). |
Related #5044 |
Describe the bug
Hello everyone. I am trying to use models deployed in Azure AI Studio, using the Azure Endpoint (not Azure OpenAI).
I have deployed the models, and from my understanding I need to set
llm_config
to containapi_key
andbase_url
from the specific resource from Azure. In this case I am using a serverless endpoint that hosts a Mistral-large model.I am 99% confident that the connection between Autogen and Azure Endpoint has been established, because I can get a reply back from the model using as a
summary_method
the last message and also I was able to use it and have it call a tool.From the error message, I figured out that a message with type "assistant" tries to be send to the model but it's not supported. This is created somewhere in
client.py
. It's there a hacky way, I can get around this?Steps to reproduce
You will need a model deployed in Azure AI Studio (or I guess just a Mistral model)
Then using two agents a simple
initiate_chat
withsummary_method="relfection_with_llm"
will show the behavior I describe.Model Used
mistral-large deployed on Azure AI Studio
Expected Behavior
When I am using a gpt model as a foundation model, I can set
summary_method
andsummary_args
to get a summarized version of the chat between agents.For example
And a summary is returned.
Screenshots and logs
The conversation took place ->
but then I got this error message
Additional Information
pyautogen==0.2.26
python 3.10.11
The text was updated successfully, but these errors were encountered: