[PR #8209] [CLOSED] api: enable passing images in raw mode #12665

Closed
opened 2026-04-13 00:06:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8209
Author: @rylativity
Created: 12/22/2024
Status: Closed

Base: mainHead: raw-prompt-images


📝 Commits (4)

  • a16d668 this adds param to request params and adds images to beginning of raw prompts when set to true; associated documentation update in docs/api.md
  • c2c3a4f this updates docs/
  • de1eef3 this adds clarific
  • 72f6c10 this simplifies example in api.md for manually adding image placeholders by removing unneeded param

📊 Changes

3 files changed (+100 additions, -0 deletions)

View changed files

📝 api/types.go (+3 -0)
📝 docs/api.md (+89 -0)
📝 server/routes.go (+8 -0)

📄 Description

I belive this should be considered a bug fix, as it resolves unexpected behavior and clarifies how to use undocumented capabilities - Images were not being passed to multimodal models when images were provided and raw was set to true as described in this issue.

This change introduces an optional boolean parameter prepend_images_to_raw_prompt, which if set to true will add the image placeholder fields necessary to pass the images through to the multimodal model. This parameter only has effect if raw is also set to true and images are provided. The prepend_images_to_raw_prompt parameter can be omitted, and the default behavior remains entirely unchanged to avoid breaking existing users.

It also updates the api.md documentation to describe the new functionality (including an example request/response), and also provides and example of manually passing an image placeholder in the text of a raw prompt directly, which offers more control over where the image is inserted in the raw prompt.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/8209 **Author:** [@rylativity](https://github.com/rylativity) **Created:** 12/22/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `raw-prompt-images` --- ### 📝 Commits (4) - [`a16d668`](https://github.com/ollama/ollama/commit/a16d66815ef8264283d92287d6e81535d022668c) this adds param to request params and adds images to beginning of raw prompts when set to true; associated documentation update in docs/api.md - [`c2c3a4f`](https://github.com/ollama/ollama/commit/c2c3a4ff2b2aa2f92a47c446da60d5c52dcb0f3a) this updates docs/ - [`de1eef3`](https://github.com/ollama/ollama/commit/de1eef31653ef2734ffbb9565a66c5c97717824e) this adds clarific - [`72f6c10`](https://github.com/ollama/ollama/commit/72f6c10f00e6624db68f03a61448b51be853138f) this simplifies example in api.md for manually adding image placeholders by removing unneeded param ### 📊 Changes **3 files changed** (+100 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+3 -0) 📝 `docs/api.md` (+89 -0) 📝 `server/routes.go` (+8 -0) </details> ### 📄 Description I belive this should be considered a bug fix, as it resolves unexpected behavior and clarifies how to use undocumented capabilities - Images were not being passed to multimodal models when `images` were provided and `raw` was set to true as described in [this issue](https://github.com/ollama/ollama-python/issues/319). This change introduces an optional boolean parameter `prepend_images_to_raw_prompt`, which if set to `true` will add the image placeholder fields necessary to pass the images through to the multimodal model. This parameter only has effect if `raw` is also set to true and `images` are provided. The `prepend_images_to_raw_prompt` parameter can be omitted, and the default behavior remains entirely unchanged to avoid breaking existing users. It also updates the api.md documentation to describe the new functionality (including an example request/response), and also provides and example of manually passing an image placeholder in the text of a raw prompt directly, which offers more control over where the image is inserted in the raw prompt. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:06:21 -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#12665