future-architect-14294
09/06/2025, 4:06 AMbetter-park-34863
09/06/2025, 1:55 PMAdvanced settings under LLM and then put the custom model along with the prefix.
If you do that and it still doesn't work, please open a github issue.future-architect-14294
09/07/2025, 2:07 AMbetter-park-34863
09/07/2025, 2:17 AMbetter-park-34863
09/07/2025, 2:18 AMbetter-park-34863
09/07/2025, 2:18 AMfuture-architect-14294
09/07/2025, 2:19 AMfuture-architect-14294
09/07/2025, 2:19 AMfuture-architect-14294
09/07/2025, 2:19 AMfuture-architect-14294
09/07/2025, 2:31 AMfuture-architect-14294
09/07/2025, 2:31 AMfuture-architect-14294
09/07/2025, 2:50 AMcan you tell me if the c++ project is correct in regards to the api connector125011 - openhandsERROR agent_controller.py:365 - [Agent Controller 5c7a29fc-d7c1-48-89974dfb317c2cc] Error while running the agent (session ID: 5c7a29fc-d7c1-48-89974dfb317c2cc): litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=x-ai/grok-code-fast-1 Pass model as E.g. For 'Huggingface' inference endpoints pass in
completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers. Traceback: Traceback (most recent call last):
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/openhands/controller/agent_controller.py", line 363, in _step_with_exception_handling
await self._step()
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/openhands/controller/agent_controller.py", line 917, in _step
raise e
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/openhands/controller/agent_controller.py", line 870, in _step
action = self.agent.step(self.state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/openhands/agenthub/codeact_agent/codeact_agent.py", line 215, in step
response = self.llm.completion(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/tenacity/__init__.py", line 477, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/tenacity/__init__.py", line 480, in call
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/openhands/llm/llm.py", line 328, in wrapper
resp: ModelResponse = self._completion_unwrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/litellm/utils.py", line 1344, in wrapper
raise e
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/litellm/utils.py", line 1219, in wrapper
result = original_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/litellm/main.py", line 3494, in completion
raise exception_type(
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/litellm/main.py", line 1103, in completion
model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(
^^^^^^^^^^^^^^^^^
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 401, in get_llm_provider
raise e
File "/home/andrewcz/OpenHands/.venv/lib64/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 378, in get_llm_provider
raise litellm.exceptions.BadRequestError( # type: ignore
litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=x-ai/grok-code-fast-1
Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers
125011 - openhandsERROR loop.py:24 - BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=x-ai/grok-code-fast-1
Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers
Agent running... (Press Ctrl-P to pause)
⚠️ Session was interrupted: errorfuture-architect-14294
09/07/2025, 2:53 AM{
"code": "Client specified an invalid argument",
"error": "Argument not supported on this model: stop"
}
Here’s what this means in simple terms:
1. OpenHands, by default, sends a parameter called stop in its API request to the LLM. This parameter is used to tell the model when to stop generating text (e.g., stop when you see the word "Human:").
2. However, the specific model you've chosen (x-ai/grok-code-fast-1) does not support this stop parameter.
3. When the xAI server receives the request with this unsupported argument, it correctly rejects it with a "400 Bad Request" error.
This is not a bug in your setup but rather a compatibility issue between the default behavior of OpenHands and the specific API requirements of that particular Grok model.
The Easiest Solution: Switch to a More Compatible Model
The most reliable and straightforward way to fix this is to switch to a different high-quality model on OpenRouter that is known to be fully compatible with the standard API parameters that OpenHands uses.
A fantastic, powerful, and free option for coding on OpenRouter is Nous Hermes 2 Pro on Llama 3. It's highly capable and follows the standard API conventions.
Step-by-Step Instructions to Fix It
1. Start OpenHands again.
2. code Bash
3.
1. IGNORE_WHEN_COPYING_START
2. IGNORE_WHEN_COPYING_END
3.
4. openhands
5.
6. Go back into the settings.
7. code Code
8.
1. IGNORE_WHEN_COPYING_START
2. IGNORE_WHEN_COPYING_END
3.
4. > /settings
5.
6. Navigate to the Advanced LLM settings.
◦ Select LLM (Advanced) and press Enter.
7. Enter the New, Compatible Model Name.
• At the first prompt, enter the following model name exactly as written:
• code Code
•
• IGNORE_WHEN_COPYING_START
• IGNORE_WHEN_COPYING_END
•
• (Step 1/6) Custom Model (CTRL-c to cancel): openrouter/nousresearch/nous-hermes-2-llama-3-8b
•
◦
1. Confirm Your Other Settings.
◦ Your other settings (Base URL: https://openrouter.ai/api/v1, your API key, etc.) are all correct. You should be able to press Enter on each of the following steps to accept the current values.
2. Save, Exit, and Restart.
◦ Save the new settings when prompted.
◦ Exit OpenHands with /exit.
◦ Start openhands one last time.
Now, OpenHands will send its requests to a model that fully supports all of its features.
Test with a Simple Prompt
Once you've restarted, test it with a clear, simple task to ensure everything is working:
Read the fileThis will confirm that the agent can read your files and the LLM connection is fully operational.and list the names of all the public methods in thesrc/BinanceConnector.cppclass.BinanceConnector
future-architect-14294
09/07/2025, 3:05 AMfuture-architect-14294
09/07/2025, 4:02 AMbetter-park-34863
09/07/2025, 1:24 PM