mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
ollama.create How to create models from local files without modelfile?
#208
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @winternewt on GitHub (Jan 28, 2025).
It seems there was a breaking change in API since 0.4.5, because my code calling
model.createto load local models ggufs no longer works,modelfile=keyword disappeared, seemingly without any deprecation warnings (at least not in pydantic model,modelfile wasn't marked as deprecated field ).I'm hesitant to downgrade, since I'm looking forward to DeepSeek R1 support, but I'm having trouble adapting my code:
Neither attempt at a direct use of the same fields,
Nor an attempt to use
fileskeywordhttps://github.com/ollama/ollama-python/blob/0561f427011cf93e65f3f4b0de60d814cc7a754a/ollama/_types.py#L415
Pydantic model hints it expects a dict, instead, but what should I put as key-value?
"something":path?
I haven't found any example use, description, or API reference for the field, please kindly assist
@ParthSareen commented on GitHub (Jan 28, 2025):
Hi @winternewt! Really sorry about that - we realized that we should've marked it as a breaking change. Apologies for the confusion.
I think this should solve your issue but let me know if it doesn't: https://github.com/ollama/ollama/blob/2ef3c803a151a0a9b1776c9ebe6a7e86b3971660/docs/api.md#create-a-model-from-gguf