danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, AWS, OpenAI, Assistants API, Azure, Groq, o1, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
19.41k stars 3.24k forks source link

[Bug]: Ollama models missing from selection list if name is capitalized #4654

Closed RobbySingh closed 3 weeks ago

RobbySingh commented 3 weeks ago

What happened?

image

# Definition of custom endpoints                                                                                                                               
endpoints:                                                                                                                                                     
  custom:                                                                                                                                                      
      - name: "Ollama" # "Ollama" -> no models. "ollama" -> models                                                                                                                                         
        apiKey: "ollama"                                                                                                                                       
        baseURL: "http://host.docker.internal:11434/v1/chat/completions"                                                                                       
        models:                                                                                                                                                
          default: [                                                                                                                                           
            "llama3:latest"                                                                                                                                    
          ]                                                                                                                                                    
          fetch: true                                                                                                                                          
        titleConvo: true                                                                                                                                       
        titleModel: "current_model"                                                                                                                            
        summarize: false                                                                                                                                       
        summaryModel: "current_model"                                                                                                                          
        forcePrompt: false                                                                                                                                     
        modelDisplayLabel: "ollama"                                                                                                                            
        capabilities: ["retrieval", "actions", "tools", "image_vision", "code_interpreter"]                                                                    

When I updated from v0.75.2 -> v0.75, my Ollama model list stopped loading. I saw that my models were loading from the /api/models endpoint correctly, but they were under the key "ollama".

The docs say that this should be case insensitive:

    # with `ollama` (case-insensitive), as it does in this example.

The example uses the titlecase "Ollama" as the example custom_endpoint name:

https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints/ollama

  custom:
    - name: "Ollama"
      apiKey: "ollama"
      # use 'host.docker.internal' instead of localhost if running LibreChat in a docker container
      baseURL: "http://localhost:11434/v1/chat/completions" 
      models:
        default: [
          "llama2",
          "mistral",
          "codellama",
          "dolphin-mixtral",
          "mistral-openorca"
          ]
        # fetching list of models is supported but the `name` field must start
        # with `ollama` (case-insensitive), as it does in this example.
        fetch: true
      titleConvo: true
      titleModel: "current_model"
      summarize: false
      summaryModel: "current_model"
      forcePrompt: false
      modelDisplayLabel: "Ollama"

Steps to Reproduce

  1. Setup Ollama using a custom_endpoint and download a model
  2. Set the name to "Ollama"
  3. -> No models returned
  4. Set the name to "ollama"
  5. -> All models returned

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Screenshots

No response

Code of Conduct

danny-avila commented 3 weeks ago

Closed by https://github.com/danny-avila/LibreChat/pull/4657