examples: show full Modelfile surface in create.py, add create-gguf.py - #730
Open
jhaveri-bhavya wants to merge 1 commit into
Open
jhaveri-bhavya wants to merge 1 commit into
jhaveri-bhavya wants to merge 1 commit into
Conversation
create.py only set from_ and system, which makes it look like create() can't express a full Modelfile. Expand it to cover template, parameters, messages and license too, with a comment mapping each kwarg to its Modelfile directive. Add create-gguf.py for the weights-import path: upload the file with create_blob() and pass the returned digest through files=. Refs ollama#664, ollama#431
jhaveri-bhavya
force-pushed
the
examples-create-directives
branch
from
September 17, 2026 12:33
c451b17 to
8f13b47
Compare
Author
|
Greeting @ParthSareen: For context: this expands examples/create.py to cover the full Modelfile directive surface (template, parameters, messages, license, not just from_/system) and adds examples/create-gguf.py showing the create_blob() + files= import path, per the discussion in #664 / #431. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #664
Refs #431
examples/create.pyonly setsfrom_andsystem. Since the rawmodelfile=string was removed in #430, that thin example is probably what leads people to thinkcreate()can't build a real Modelfile (see #664, and the GGUF-import confusion in #431).Changes:
create.py: also passtemplate,parameters,messagesandlicense, with a short comment mapping each kwarg to its Modelfile directive.create-gguf.py(new): the weights-import path —create_blob()to upload, thenfiles=with the returned digest.README.md: retitle the section and list the new example.Examples only, no library changes. Ran both scripts against a local
ollama serve;ollama show my-assistant --modelfileafterwards lists FROM/SYSTEM/TEMPLATE/PARAMETER/MESSAGE/LICENSE as set.