Skip to content

client: upload local create blobs#685

Open
srinivasBJ wants to merge 3 commits into
ollama:mainfrom
srinivasBJ:codex/create-upload-local-blobs
Open

client: upload local create blobs#685
srinivasBJ wants to merge 3 commits into
ollama:mainfrom
srinivasBJ:codex/create-upload-local-blobs

Conversation

@srinivasBJ

Copy link
Copy Markdown

Summary

  • allow create files and adapters to accept local paths and upload them as blobs before create
  • add sync and async version and check_blob helpers
  • add sync and async coverage for local path uploads, digest passthrough, version, and blob checks

Validation

  • .venv/bin/python -m pytest tests
  • .venv/bin/ruff check ollama tests
  • git diff --check

Add missing fields to ListResponse.Model that the server's GET /api/tags
endpoint already returns but the Python client was silently dropping:

  - name: human-readable model name
  - remote_model: upstream model identifier for remote models
  - remote_host: hostname of the remote model provider
  - capabilities: list of model capabilities (chat, completion, etc.)

All new fields are Optional to preserve backward compatibility with
older server versions.

Includes unit tests for Client.list() and AsyncClient.list() that
verify full deserialization of the updated response schema.

Resolves ollama#561
Support passing a Modelfile string directly to the create endpoint,
restoring functionality that was available in earlier versions of the
API but missing from the current Python client.

The modelfile parameter accepts a multi-line string containing FROM,
SYSTEM, PARAMETER, and other Modelfile directives. This is forwarded
as-is to the server's POST /api/create endpoint.

Update the create.py example to demonstrate Modelfile-based model
creation.

Resolves ollama#664
@srinivasBJ srinivasBJ marked this pull request as ready for review June 22, 2026 21:14
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