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

[BUG] OpenAIServerModel doesn't work with vLLM serve properly #908

Open
ErokhinVi opened this issue Mar 7, 2025 · 0 comments
Open

[BUG] OpenAIServerModel doesn't work with vLLM serve properly #908

ErokhinVi opened this issue Mar 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ErokhinVi
Copy link

Describe the bug
I have deployed the Qwen 2.5 32B model using vllm serve. I created an OpenAIServerModel and am trying to run an agent on it. However, I get an error on the first and subsequent steps

Code to reproduce the error
`model = OpenAIServerModel(
model_id="large",
api_base=llm_api_url,
api_key=os.getenv("LLM_API_KEY"),
temperature=0.2,
)

agent = CodeAgent(
tools=[],
add_base_tools=False,
model=model,
max_steps=10,
additional_authorized_imports=[
"json",
"pandas",
"sqlite3",
],
)

agent.run("How to make pizza ?")
`

Error logs (if any)
Error in generating model output:
Error code: 500 - {'message': 'Internal server error'}

Expected behavior
I expect that i have no error :))

Packages version:
smolagents==1.9.2

Additional context
I figured out how to fix this. The error occurs due to the flatten_messages_as_text parameter in the models.py script. If it is manually set to True by default, the issue is resolved. However, I haven't found a way to set it via kwargs or other methods :(

@ErokhinVi ErokhinVi added the bug Something isn't working label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant