[GH-ISSUE #14721] API support for attaching files (PDF, JSON, images, bytes/base64) like the UI #9518

Open
opened 2026-04-12 22:26:26 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @HamzaYslmn on GitHub (Mar 8, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14721

The UI can directly attach sources like PDFs, JSON, and images and use them automatically as context.

I want the same on the API side, especially for Python.

The main point is that Ollama should process these automatically and include them in context, without me having to manually extract content and inject it into the prompt.

Example Python use case:
send a prompt, attach a PDF/JSON/image, and let Ollama use them directly.

This would make API usage much cleaner and bring it closer to the native feature set.

Originally created by @HamzaYslmn on GitHub (Mar 8, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14721 The UI can directly attach sources like PDFs, JSON, and images and use them automatically as context. I want the same on the API side, especially for Python. The main point is that Ollama should process these automatically and include them in context, without me having to manually extract content and inject it into the prompt. Example Python use case: send a prompt, attach a PDF/JSON/image, and let Ollama use them directly. This would make API usage much cleaner and bring it closer to the native feature set.
GiteaMirror added the feature request label 2026-04-12 22:26:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9518