Skip to content

Example on local llama use? #5

Closed

Description

@manugarri

It would be great to have an example of how to integrate this with llama. Its mentioned in the docs but there is no example on how to use it with llama (or ollama)

Activity

  1. MagMueller commented on Nov 6, 2024

    @MagMueller
    Collaborator

    Here's a complete example of how to use browser-use with Llama via Ollama:

    Setup

    # Install dependencies
    pip install langchain-ollama browser-use
    
    # Install Ollama (macOS)
    brew install ollama
    # Or Linux
    curl -fsSL https://ollama.com/install.sh | sh
    
    # Start Ollama
    ollama serve
    
    # Pull model locally
    ollama pull  llama3-groq-tool-use:8b 

    Example:

    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    from dotenv import load_dotenv
    
    load_dotenv()
    
    llm = ChatOllama(
        model="llama3-groq-tool-use:8b",
        base_url="http://localhost:11434",
    )
    
    agent = Agent(
        task="Go to google.com and search for 'Albert Einstein'.",
        llm=llm,
    )
    
    run(agent.run())

    Note: This model currently struggles with JSON output formatting, which can cause the agent to break.

    We need to develop a robuster system for this.

  2. manugarri commented on Nov 6, 2024

    @manugarri
    Author

    does that example work for you? Would you mind sharing your python and langchain-core version?

    My local ollama server returns the following json, which seems ok {'args': {'action': {'search_google': {'query': 'Albert Einstein'}}, 'current_state': {}}, 'type': 'Output'}

    However, the script fails with the following stacktrace

    INFO:browser_use.agent.service:
    📍 Step 1
    INFO:browser_use.utils:--_process_content Execution time: 0.00 seconds
    INFO:browser_use.utils:--get_cached_browser_state Execution time: 0.52 seconds
    INFO:browser_use.agent.service:current tabs: [{'handle': '401296479A56DA7F0848BEA9AC1BD962', 'url': 'data:,', 'title': '', 'is_current': True}]
    INFO:httpx:HTTP Request: POST http://localhost:11434/api/chat "HTTP/1.1 200 OK"
    {'args': {'action': {'search_google': {'query': 'Albert Einstein'}}, 'current_state': {}}, 'type': 'Output'}
    Traceback (most recent call last):
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/test.py", line 18, in <module>
        run(agent.run())
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 194, in run
        return runner.run(main)
               ^^^^^^^^^^^^^^^^
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 118, in run
        return self._loop.run_until_complete(task)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
        return future.result()
               ^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/agent/service.py", line 82, in run
        action, result = await self.step()
                         ^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/utils.py", line 36, in wrapper
        result = await func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/agent/service.py", line 100, in step
        action = await self.get_next_action(state)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/utils.py", line 36, in wrapper
        result = await func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/agent/service.py", line 172, in get_next_action
        response: Output = await structured_llm.ainvoke(input_messages)  # type: ignore
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3066, in ainvoke
        input = await asyncio.create_task(part(), context=context)  # type: ignore
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 216, in ainvoke
        return await self._acall_with_config(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1978, in _acall_with_config
        output: Output = await asyncio.create_task(coro, context=context)  # type: ignore
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 277, in aparse_result
        return await run_in_executor(None, self.parse_result, result, partial=partial)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/config.py", line 588, in run_in_executor
        return await asyncio.get_running_loop().run_in_executor(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/concurrent/futures/thread.py", line 58, in run
        result = self.fn(*self.args, **self.kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/config.py", line 579, in wrapper
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/openai_tools.py", line 300, in parse_result
        raise e
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/openai_tools.py", line 295, in parse_result
        pydantic_objects.append(name_dict[res["type"]](**res["args"]))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/pydantic/main.py", line 212, in __init__
        validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    pydantic_core._pydantic_core.ValidationError: 3 validation errors for Output
    current_state.valuation_previous_goal
      Field required [type=missing, input_value={}, input_type=dict]
        For further information visit https://errors.pydantic.dev/2.9/v/missing
    current_state.memory
      Field required [type=missing, input_value={}, input_type=dict]
        For further information visit https://errors.pydantic.dev/2.9/v/missing
    current_state.next_goal
      Field required [type=missing, input_value={}, input_type=dict]
        For further information visit https://errors.pydantic.dev/2.9/v/missing
    
  3. gregpr07 commented on Nov 7, 2024

    @gregpr07
    Member

    Hey, I think Llama 8B might be too small for this to really work properly - big models like Claude 3.5 sonnet are also sometimes barely smart enough.

    I have tested browser use with Llama 405B on Fireworks and that works quite well, it's just a bit slower usually than gpt4o or Claude. I think 70B should also work just fine.

    Which provider do you plan on using? Tell me and I can help you more!

  4. manugarri commented on Nov 7, 2024

    @manugarri
    Author

    Thanks for the answer, I dont think the error im experiencing is due to the model size, isnt it? I wasnt planning on using a remote model yet, I would like to do the development locally to avoid costs.

  5. gregpr07 commented on Nov 7, 2024

    @gregpr07
    Member

    Do you have the compute to try larger model? Maybe llama3-groq-tool-use:70b?

  6. MagMueller commented on Nov 8, 2024

    @MagMueller
    Collaborator

    I tried ChatOllama with qwen2.5:32b-instructand couple of llama models.
    The main problem is that pydantic with structured output needs to be fixed by ChatOllama see this issue.
    JSON output works - but is not robust.

    As soon as it works, I will include examples.

  7. MagMueller commented on Nov 10, 2024

    @MagMueller
    Collaborator

    I tried it now also with json mode - this works for the first action step; but with multiple steps it forgets the instructions

  8. manugarri commented on Nov 13, 2024

    @manugarri
    Author

    @gregpr07 I tried running with llama3-groq-tool-use:8b and using json mode. for the following snippet

    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    
    llm = ChatOllama(
        model="llama3-groq-tool-use:70b",
        base_url="http://localhost:11434",
        format='json',
    )
    
    agent = Agent(
        task="Go to google.com and search for 'Albert Einstein'.",
        llm=llm,
    )
    
    run(agent.run())
    

    It fails with the error:

    Traceback (most recent call last):
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/test.py", line 19, in <module>
        run(agent.run())
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 194, in run
        return runner.run(main)
               ^^^^^^^^^^^^^^^^
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 118, in run
        return self._loop.run_until_complete(task)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
        return future.result()
               ^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/agent/service.py", line 82, in run
        action, result = await self.step()
                         ^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/utils.py", line 36, in wrapper
        result = await func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/agent/service.py", line 100, in step
        action = await self.get_next_action(state)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/utils.py", line 36, in wrapper
        result = await func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/browser_use/agent/service.py", line 172, in get_next_action
        response: Output = await structured_llm.ainvoke(input_messages)  # type: ignore
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3066, in ainvoke
        input = await asyncio.create_task(part(), context=context)  # type: ignore
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 216, in ainvoke
        return await self._acall_with_config(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1978, in _acall_with_config
        output: Output = await asyncio.create_task(coro, context=context)  # type: ignore
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/base.py", line 277, in aparse_result
        return await run_in_executor(None, self.parse_result, result, partial=partial)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/config.py", line 588, in run_in_executor
        return await asyncio.get_running_loop().run_in_executor(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/manuel/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/concurrent/futures/thread.py", line 58, in run
        result = self.fn(*self.args, **self.kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/runnables/config.py", line 579, in wrapper
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/d/Backup/Proyectos/llm_projects/browser_use/.venv/lib/python3.12/site-packages/langchain_core/output_parsers/openai_tools.py", line 295, in parse_result
        pydantic_objects.append(name_dict[res["type"]](**res["args"]))
                                ~~~~~~~~~^^^^^^^^^^^^^
    KeyError: 'search Google'
    

    You mention on the Project Readme that it works with llama. Have you tested it successfully with llama? Could you maybe share a example that actually works?

  9. oberfx commented on Nov 13, 2024

    @oberfx

    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    from dotenv import load_dotenv

    Cargar variables de entorno

    load_dotenv()

    Configurar el modelo ChatOllama

    llm = ChatOllama(
    model="llama3-groq-tool-use:8b-q2_K",
    base_url="http://localhost:11434",
    )

    Configurar el agente con la tarea deseada

    agent = Agent(
    task="Go to google.com and search for 'piso en venta en aviles'.",
    llm=llm,
    )

    Función para ejecutar el agente paso a paso

    async def run_agent():
    max_steps = 50 # Limitar el número de pasos
    for step in range(max_steps):
    print(f"\n📍 Step {step+1}")
    try:
    # Ejecutar un paso del agente
    action, result = await agent.step()

            # Asegurarse de que la memoria sea una cadena antes de continuar
            if hasattr(result, "current_state") and hasattr(result.current_state, "memory"):
                if isinstance(result.current_state.memory, dict):
                    # Convertir a cadena si memory es un diccionario
                    result.current_state.memory = str(result.current_state.memory)
                elif result.current_state.memory is None:
                    # Manejar el caso donde memory es None
                    result.current_state.memory = ""
    
            print("Action:", action)
            print("Result:", result)
    
            # Verificar si la tarea está completada
            if result.done:
                print("\n✅ Task completed successfully!")
                print("Extracted content:", result.extracted_content)
                break
        except AttributeError as e:
            print("Error:", e)
            print("The model did not return a valid response.")
            break
        except Exception as e:
            # Cualquier otro error
            print("Unexpected error:", e)
            break
    

    Ejecutar el agente

    run(run_agent())

  10. manugarri commented on Nov 13, 2024

    @manugarri
    Author

    @oberfx your markdown is all wonky :D I think i managed to copy it correctly, and still fails with the error

    📍 Step 1
    INFO:browser_use.utils:--_process_content Execution time: 0.00 seconds
    INFO:browser_use.utils:--get_cached_browser_state Execution time: 1.05 seconds
    INFO:browser_use.agent.service:current tabs: [{'handle': '9CE7784CCFA4E219BB6DBB002047335C', 'url': 'data:,', 'title': '', 'is_current': True}]
    INFO:httpx:HTTP Request: POST http://localhost:11434/api/chat "HTTP/1.1 200 OK"
    {'args': {'action': {'search_google': {'query': 'Albert Einstein'}}, 'current_state': {'memory': 'no memory yet', 'next_goal': 'Go back to previous page', 'valuation_previous_goal': 'Failed because the previous goal was to go to google.com'}}, 'type': 'Output'}
    INFO:browser_use.agent.service:current state
    : {
       "valuation_previous_goal": "Failed because the previous goal was to go to google.com",
       "memory": "no memory yet",
       "next_goal": "Go back to previous page"
    }
    INFO:browser_use.agent.service:action
    : {
       "ask_human": null,
       "search_google": {
           "query": "Albert Einstein"
       },
       "go_to_url": null,
       "nothing": null,
       "go_back": null,
       "done": null,
       "click_element": null,
       "input_text": null,
       "extract_page_content": null,
       "switch_tab": null,
       "open_tab": null
    }
    INFO:browser_use.utils:--get_next_action Execution time: 5.75 seconds
    INFO:browser_use.utils:--get_cached_browser_state Execution time: 0.00 seconds
    INFO:browser_use.browser.service:--Page loaded in 0.96 seconds, waiting for additional 0.00 seconds
    INFO:browser_use.utils:--act Execution time: 1.29 seconds
    INFO:browser_use.utils:--step Execution time: 8.76 seconds
    Action: ask_human=None search_google=SearchGoogleControllerAction(query='Albert Einstein') go_to_url=None nothing=None go_back=None done=None click_element=None input_text=None extract_page_content=None switch_tab=None open_tab=None url='data:,'
    Result: done=False extracted_content=None error=None
    
    📍 Step 2
    INFO:browser_use.utils:--_process_content Execution time: 0.74 seconds
    INFO:browser_use.utils:--get_cached_browser_state Execution time: 0.78 seconds
    INFO:browser_use.agent.service:current tabs: [{'handle': '9CE7784CCFA4E219BB6DBB002047335C', 'url': 'data:,', 'title': '', 'is_current': True}]
    INFO:httpx:HTTP Request: POST http://localhost:11434/api/chat "HTTP/1.1 200 OK"
    []
    Error: 'NoneType' object has no attribute 'model_dump_json'
    The model did not return a valid response.
    
  11. oberfx commented on Nov 13, 2024

    @oberfx

    Cambia el modelo a 70B

  12. manugarri commented on Nov 13, 2024

    @manugarri
    Author

    @oberfx sigue dando fallos asi

    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    #from dotenv import load_dotenv
    
    #load_dotenv()
    
    llm = ChatOllama(
    model="llama3-groq-tool-use:70b-q2_K",
    base_url="http://localhost:11434",
        format='json',
    
    )
    
    agent = Agent(
    task="Go to google.com and search for 'piso en venta en aviles'.",
    llm=llm,
    )
    
    
    async def run_agent():
    	max_steps = 50 # Limitar el número de pasos
    	for step in range(max_steps):
    		print(f"\n📍 Step {step+1}")
    		try:
    			# Ejecutar un paso del agente
    			action, result = await agent.step()
    
    			# Asegurarse de que la memoria sea una cadena antes de continuar
    			if hasattr(result, "current_state") and hasattr(result.current_state, "memory"):
    				if isinstance(result.current_state.memory, dict):
    					# Convertir a cadena si memory es un diccionario
    					result.current_state.memory = str(result.current_state.memory)
    				elif result.current_state.memory is None:
    					# Manejar el caso donde memory es None
    					result.current_state.memory = ""
    
    			print("Action:", action)
    			print("Result:", result)
    
    			# Verificar si la tarea está completada
    			if result.done:
    				print("\n✅ Task completed successfully!")
    				print("Extracted content:", result.extracted_content)
    				break
    		except AttributeError as e:
    			print("Error:", e)
    			print("The model did not return a valid response.")
    			raise e
    		except Exception as e:
    			# Cualquier otro error
    			print("Unexpected error:", e)
    			break
    
    
    run(run_agent())
    

    A ti te ha funcionado?

  13. Rakesh-gene commented on Nov 22, 2024

    @Rakesh-gene

    agent

    This solution also did not work. await agent.step() return type is None.

  14. brutuscat commented on Nov 25, 2024

    @brutuscat

    pydantic_core._pydantic_core.PydanticSerializationError: Error calling function serialize_model: OSError: [Errno 63] File name too long:

    Here's a complete example of how to use browser-use with Llama via Ollama:

    Setup

    # Install dependencies
    pip install langchain-ollama browser-use
    
    # Install Ollama (macOS)
    brew install ollama
    # Or Linux
    curl -fsSL https://ollama.com/install.sh | sh
    
    # Start Ollama
    ollama serve
    
    # Pull model locally
    ollama pull  llama3-groq-tool-use:8b 

    Example:

    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    from dotenv import load_dotenv
    
    load_dotenv()
    
    llm = ChatOllama(
        model="llama3-groq-tool-use:8b",
        base_url="http://localhost:11434",
    )
    
    agent = Agent(
        task="Go to google.com and search for 'Albert Einstein'.",
        llm=llm,
    )
    
    run(agent.run())

    Note: This model currently struggles with JSON output formatting, which can cause the agent to break.

    We need to develop a robuster system for this.

    Trying this with 70b model, geeting weird MacOS error:

    Stacktrace:
    Traceback (most recent call last):
    File "/Users/path/ai-browser/lib/python3.13/site-packages/browser_use/agent/service.py", line 123, in step
    model_output = await self.get_next_action(state)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/browser_use/utils.py", line 36, in wrapper
    result = await func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/browser_use/agent/service.py", line 188, in get_next_action
    response: dict[str, Any] = await structured_llm.ainvoke(input_messages) # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/runnables/base.py", line 3066, in ainvoke
    input = await asyncio.create_task(part(), context=context) # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/runnables/base.py", line 3773, in ainvoke
    results = await asyncio.gather(
    ^^^^^^^^^^^^^^^^^^^^^
    ...<10 lines>...
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/runnables/base.py", line 3763, in _ainvoke_step
    return await asyncio.create_task( # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    step.ainvoke(input, child_config), context=context
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/runnables/base.py", line 5366, in ainvoke
    return await self.bound.ainvoke(
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/language_models/chat_models.py", line 307, in ainvoke
    llm_result = await self.agenerate_prompt(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/language_models/chat_models.py", line 796, in agenerate_prompt
    return await self.agenerate(
    ^^^^^^^^^^^^^^^^^^^^^
    prompt_messages, stop=stop, callbacks=callbacks, **kwargs
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/language_models/chat_models.py", line 756, in agenerate
    raise exceptions[0]
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_core/language_models/chat_models.py", line 924, in _agenerate_with_cache
    result = await self._agenerate(
    ^^^^^^^^^^^^^^^^^^^^^^
    messages, stop=stop, run_manager=run_manager, **kwargs
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_ollama/chat_models.py", line 731, in _agenerate
    final_chunk = await self._achat_stream_with_aggregation(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    messages, stop, run_manager, verbose=self.verbose, **kwargs
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_ollama/chat_models.py", line 588, in _achat_stream_with_aggregation
    async for stream_resp in self._acreate_chat_stream(messages, stop, **kwargs):
    ...<27 lines>...
    )
    File "/Users/path/ai-browser/lib/python3.13/site-packages/langchain_ollama/chat_models.py", line 479, in _acreate_chat_stream
    yield await self._async_client.chat(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    ) # type:ignore
    ^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/ollama/_client.py", line 845, in chat
    ).model_dump(exclude_none=True),
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
    File "/Users/path/ai-browser/lib/python3.13/site-packages/pydantic/main.py", line 426, in model_dump
    return self.pydantic_serializer.to_python(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    self,
    ^^^^^
    ...<10 lines>...
    serialize_as_any=serialize_as_any,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
    pydantic_core._pydantic_core.PydanticSerializationError: Error calling function serialize_model: OSError: [Errno 63] File name too long: 'iVBORw0KGgoAAAANSUhEUgAABQAAAAQACAIAAAAx8WMUAAAAAXNSR0IArs4c6QAAF59JREFUeJzt18ENwCAQwLDS/Xc+tgCJ2BPkmzUzHwAAALzuvx0AAAAAJxhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJBggAEAAEgwwAAAACQYYAAAABIMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDDAAAAAJBhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJBggAEAAEgwwAAAACQYYAAAABIMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDDAAAAAJBhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJBggAEAAEgwwAAAACQYYAAAABIMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDDAAAAAJBhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJBggAEAAEgwwAAAACQYYAAAABIMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDD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IMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDDAAAAAJBhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJBggAEAAEgwwAAAACQYYAAAABIMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDDAAAAAJBhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJBggAEAAEgwwAAAACQYYAAAABIMMAAAAAkGGAAAgAQDDAAAQIIBBgAAIMEAAwAAkGCAAQAASDDAAAAAJBhgAAAAEgwwAAAACQYYAACABAMMAABAggEGAAAgwQADAACQYIABAABIMMAAAAAkGGAAAAASDDAAAAAJBhgAAIAEAwwAAECCAQYAACDBAAMAAJCwAYoKCv27r4piAAAAAElFTkSuQmCC'

  15. yuyangchee98 commented on Dec 26, 2024

    @yuyangchee98

    Tried

    from browser_use import Agent
    from langchain_ollama import ChatOllama
    
    llm = ChatOllama(
        model="llama3-groq-tool-use:70b",
        base_url="http://localhost:11434",
        format='json',
    )
    
    agent = Agent(
        task="Go to google.com and search for 'Albert Einstein'.",
        llm=llm,
    )
    
    run(agent.run())
    

    My error

    📍 Step 1
    ERROR    [agent] ❌ Result failed 1/5 times:
     'NoneType' object has no attribute 'action'
    INFO     [agent]
    📍 Step 1
    ERROR    [agent] ❌ Result failed 2/5 times:
     'NoneType' object has no attribute 'action'
    INFO     [agent]
    📍 Step 1
    ERROR    [agent] ❌ Result failed 3/5 times:
     'NoneType' object has no attribute 'action'
    INFO     [agent]
    📍 Step 1
    ERROR    [agent] ❌ Result failed 4/5 times:
     'NoneType' object has no attribute 'action'
    INFO     [agent]
    📍 Step 1
    ERROR    [agent] ❌ Result failed 5/5 times:
     'NoneType' object has no attribute 'action'
    ERROR    [agent] ❌ Stopping due to 5 consecutive failures```
    
  16. sbhavani commented on Dec 26, 2024

    @sbhavani

    @yuyangchee98 getting the same error

  17. rhyliieee commented on Dec 26, 2024

    @rhyliieee

    @yuyangchee98 getting the same error

    I think you should use a multi-modal model for it since when we initiate a task with browser use, it labels each element from the current webpage which the Model Takes as input and perform necessary action. Tried other text models but I got that same error, but when I tried vision models like the Pixtral, and deepseek, it works just fine.

  18. sbhavani commented on Dec 27, 2024

    @sbhavani

    @csharpmastr any specific model id you'd recommend with ollama? I've tried the deepseek tools and it doesn't work.

  19. rhyliieee commented on Dec 27, 2024

    @rhyliieee

    I never tried setting up an Ollama server before. But try this:

    1. Create an Account from Mistral AI Le Plateforme
    2. Obtain an API KEY
    3. Use the OpenAI compatible api from the API Tab
    4. Instead of using ChatMistralAI or ChatOllama from langchain chat models (since multi modal inputs are not supported in these chat models) use ChatOpenAI
    5. Then use the API KEY, model name, and base_url,
      llm = ChatOpenAI( model=model_name, api_key=os.getenv(‘MISTRAL_API_KEY’), base_url=url )
  20. rhyliieee commented on Dec 27, 2024

    @rhyliieee

    I notice you’re using ChatOllama which doesn’t support multi-modal inputs where ai think browser-use requires a multi-modal model for it to properly work.

    Check out this link to view Langchain chat models that support multi-modal inputs: https://python.langchain.com/docs/integrations/chat/

  21. yuyangchee98 commented on Dec 29, 2024

    @yuyangchee98

    I notice you’re using ChatOllama which doesn’t support multi-modal inputs where ai think browser-use requires a multi-modal model for it to properly work.

    Check out this link to view Langchain chat models that support multi-modal inputs: https://python.langchain.com/docs/integrations/chat/

    I see. So it looks like the only way to run this is through ChatNVIDIA.

  22. rhyliieee commented on Dec 29, 2024

    @rhyliieee

    I notice you’re using ChatOllama which doesn’t support multi-modal inputs where ai think browser-use requires a multi-modal model for it to properly work.
    Check out this link to view Langchain chat models that support multi-modal inputs: https://python.langchain.com/docs/integrations/chat/

    I see. So it looks like the only way to run this is through ChatNVIDIA.

    You can also use other Chat Models from langchain. As of this writing, there are 6 chat models from langchain that supports multi-modal inputs.

  23. yuyangchee98 commented on Dec 29, 2024

    @yuyangchee98

    I notice you’re using ChatOllama which doesn’t support multi-modal inputs where ai think browser-use requires a multi-modal model for it to properly work.
    Check out this link to view Langchain chat models that support multi-modal inputs: https://python.langchain.com/docs/integrations/chat/

    I see. So it looks like the only way to run this is through ChatNVIDIA.

    You can also use other Chat Models from langchain. As of this writing, there are 6 chat models from langchain that supports multi-modal inputs.

    Chatnvidia is the only one that works locally and supports multi modal though? According to that site you linked

  24. grigio commented on Jan 4, 2025

    @grigio

    +1 I tried via Ollama but I don't think there is a local model that supports vision+tools at the same time

  25. added a commit that references this issue on Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions