Skip to content

Conversation

@ramasubbareddy1224
Copy link

Summary

This PR fixes the model name extraction logic in ensure_model_pulled() to correctly parse the Ollama API response structure.

Changes

  • Line 30: Added extraction logic to parse model names from the ollama.list() response
    • The API returns: {'models': [{'name': 'llama3.2:1b', 'model': 'llama3.2:1b', ...}]}
    • Extracts the model field from each entry in the models array using: {m["model"] for m in available_model_list.get("models", [])}
    • Ensures the function can properly identify which models are already available locally

Testing

  • Verified that the extraction correctly identifies available models from the Ollama API response
  • Confirmed the function can now properly check if a model exists before attempting to pull it

Fixed model name extraction from Ollama API response.  This ensures the function can properly identify which models are already available locally before attempting to pull them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant