ollama / ollama

Get up and running with Llama 3.1, Mistral, Gemma 2, and other large language models.
https://ollama.com
MIT License
88.3k stars 6.89k forks source link

Alias names for models #5914

Closed jpummill closed 4 days ago

jpummill commented 1 month ago

Model names are hard to remember. They can be very long and somewhat cryptic.

For example, I may have the following models on my system for testing: mistral-nemo:12b-instruct-2407-q3_K_S mistral-nemo:12b-instruct-2407-q4_K_S mistral-nemo:12b-instruct-2407-q5_K_M

I think it would be helpful to be able to create alias names for models. For example, I might use the following aliases: mn12-3, mn12-4, and mn12-5.

We would still have the true name as a reference but we could also have a column in the list output for the alias name and Ollama would be able to use either for loading.

hlstudio commented 1 month ago

you can use: ollama cp mistral-nemo:12b-instruct-2407-q3_K_S mn12-3 then: ollama run mn12-3

rick-github commented 1 month ago
ollama cp mistral-nemo:12b-instruct-2407-q3_K_S mn12-3

The copy will have pointers to the data of the original, so it doesn't take any extra space (other than the manifest file). You can find the original by looking for the Id in the output of ollama list

jpummill commented 1 month ago

Thank you @rick-github for the workaround but this will also have the effect of increasing the length of the list with additional models that aren't truly new or different. It will also force users to have to remove multiple models in order to actually remove the model files from their system.

lee-b commented 1 week ago
ollama cp mistral-nemo:12b-instruct-2407-q3_K_S mn12-3

The copy will have pointers to the data of the original, so it doesn't take any extra space (other than the manifest file). You can find the original by looking for the Id in the output of ollama list

I've been doing this, but it's proving quite unworkable as any edits to the model create a new model, which diverges, and there is no obvious way to trace it back even to bring them into sync with further manual edits since the model IDs/hashes are then different.

A true ln -s which just creates an alias that resolves to the real model would be very beneficial. This is an important workflow, to separate client configuration ("smart-model") from server configuration ("mistral-large" / "llama-3.1-405b" / etc.)

jmorganca commented 4 days ago

Hi @jpummill thanks for the issue. I think the closest thing to this right now is ollama cp. Note: it does make essentially a new pointer to the same model, and so you can safely remove the old name. I realize re-downloading an updated version of the model would mean you have to re-run the ollama cp and ollama rm, but I'm not sure there's much else we could add here.