Fix ollama model selection for ollama targets #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had an issue when using ollama targets where I could only use models which had been manually added to the hardcoded list of supported models (_OPTION_MAP). Example error output below, where the unknown key is listed as a valid key:
Error: Unknown Ollama key 'llama3.1:8b'. Valid keys: gemma3:1b, gemma3:4b, tinyllama:1.1b, nomic-embed-text:v1.5, llama3.1:8bGiven that ollama is queried for which models are available, I think it makes sense to use this query as the basis for which models are available for ollama targets.
I've modified the code to reflect this, and also removed references to _OPTION_MAP in the ollama_api module.
I also saw that when doing 'spikee list targets' it listed the first model as the default, so I've fixed the bahaviour to reflect this for ollama targets.
I've kept _DEFAULT_KEY for now to make this change easier, though I think it could probably be removed in the future.
Also, adding .sonar folder to .gitignore is helpful for those using sonarqube