langflow-ai / langflow

⛓️ Langflow is a visual framework for building multi-agent and RAG applications. It's open-source, Python-powered, fully customizable, model and vector store agnostic.

Home Page:http://www.langflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ollama error 404

AlessioGesuelliUnicam opened this issue · comments

Discussed in #1710

Originally posted by AlessioGesuelliUnicam April 16, 2024
I don't know how resolve this problem
Ollama is running but langflow return Error 404

ValueError: Error: Ollama call
failed with status code 404. Maybe
your model is not found and you
should pull the model with ollama pull llama2:latest.

  • ERROR - chat - chat.py:57
    Error in chat websocket: control frame
    too long

Acquisizione schermata 16 04 2024 alle 16 32 37  1
Acquisizione schermata 16 04 2024 alle 16 32 37  2
Acquisizione schermata 16 04 2024 alle 16 32 57  1

To resolve the Error 404 with Ollama in Langflow, ensure the base_url for the Ollama API in Langflow's configuration matches the actual endpoint where your Ollama API is hosted. If your Ollama API is not at the default "http://localhost:11434", update the base_url in the ChatOllamaComponent configuration to the correct URL. This step is crucial for Langflow to communicate with Ollama.

For the "control frame too long" error in your websocket connection, this issue arises when the websocket frame size exceeds the protocol or server's limit. To fix this, adjust the max_size parameter in your websocket server or client configuration to accommodate larger frames. Here’s an example using the websockets library in Python:

import websockets

# For a websocket server
start_server = websockets.serve(your_handler, "localhost", 6789, max_size=YourDesiredMaxSize)

# For a websocket client
async with websockets.connect('ws://yourserver:port', max_size=YourDesiredMaxSize) as websocket:
    # Your client code here

Replace YourDesiredMaxSize with a value that suits your application's needs, keeping in mind the balance between frame size and memory usage.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.