feat: OpenAI-compatible vision model support for screenshot processing - #190
feat: OpenAI-compatible vision model support for screenshot processing#190PremKumarAmbrose wants to merge 1 commit into
Conversation
- Added OpenAI-compatible endpoint configuration UI - Added model list fetch and persisted selection - Added provider-aware model handling across AI flows - Added vision-capable filter with fallback toggle
|
Hi thanks for the PR, |
|
To help with testing or for anyone using a local llama-server setup, I’ve found that Gemma 4 E4B (minimum q4km quant) performs best with the following configuration. This setup optimizes GPU offloading and ensures the vision component handles screenshot context correctly within an 8k window even with 8 images in parallel: set LLAMA_CHAT_TEMPLATE_KWARGS={"enable_thinking":false}
llama-server.exe --model your_model_path.gguf --mmproj your_mmproj_path.gguf --ctx-size 8192 --n-gpu-layers 99 --batch-size 512 --ubatch-size 512 --parallel 1 --cache-type-k q8_0 --cache-type-v q8_0 --image-max-tokens 512 --temp 0.8 --top-p 0.9 --top-k 40 --min-p 0.005 --reasoning off --no-prefill-assistant
|
|
Thanks Prem for the update. I'll review your code today. |
| # The patch version numbering is automatically incremented by the git hook. | ||
| # Only update major and minor versions manually. | ||
| version: 1.9.100+10 | ||
| version: 1.9.103+10 |
| 'gemini-2.5-flash', | ||
| 'gemini-2.5-pro', | ||
| ], | ||
| 'openai_compatible': [], |
There was a problem hiding this comment.
Is this restricted to openai ?
Since we can use any multi-modal AI to process this, a generalised term like ollama_models would be better know ?
There was a problem hiding this comment.
It's actually compatible with any model provider which uses the openai api format. We can change it into something like "openai api compatible" or keep as is to generalize it for any provider. Ollama and llama-swap are one of the providers which supports this api format.
There was a problem hiding this comment.
I'm trying to understand why are we developiong for openAI api format in the first place. Since we don't have any openai implementation or services in the codebase, native API will be more flexible is what i believe.
There was a problem hiding this comment.
I'm trying to understand why are we developiong for openAI api format in the first place. Since we don't have any openai implementation or services in the codebase, native API will be more flexible is what i believe.
The main reason for supporting the OpenAI API format is its status as a de facto industry standard for LLM APIs. While we don’t use OpenAI’s own services, the OpenAI API spec has become the most widely adopted interface for both cloud and local LLM providers. Many popular local serving solutions like Ollama, llama.cpp, LM Studio, llama-swap, and others intentionally implement the OpenAI API format to maximize compatibility with existing tools and clients.
By targeting this API, we make the app instantly compatible with a huge range of providers, both local and remote, without needing to write custom integrations for each one. This means users can run their own models locally (for privacy, cost, or speed) or connect to any compatible cloud service, simply by pointing to the right endpoint. It also future-proofs the app, since new providers almost always add OpenAI API compatibility first.
Here are the latest, valid documentation links for OpenAI API compatibility for each provider:
Ollama:
Ollama OpenAI Compatibility Documentation
llama.cpp:
llama.cpp OpenAI-Compatible Server (GitHub)
llama-cpp-python OpenAI-Compatible Server
LM Studio:
LM Studio OpenAI Compatibility Docs
llama-swap:
llama-swap GitHub (OpenAI API Compatible)
There was a problem hiding this comment.
Yeah i see that while this might be useful for fast porting from ollama to open AI.
https://docs.ollama.com/api/openai-compatibility shows some parameters are simply not available for open AI supporting APIs. Which will affect the customisations that we'll be able to bring.
Since ollama is the major provider that we are trying to import. It will be best if we implement in their native API.
There was a problem hiding this comment.
I see your point about the missing parameters in the documentation. It is true that Ollama’s native API exposes specific options that the OpenAI specification ignores. But looking at what actually gets dropped, we should weigh if they are worth the effort for Shots Studio.
The missing parameters are almost entirely low-level llama.cpp parameter tuning as ollama is basically a wrapper for llama.cpp. We lose hardware overrides like num_thread, advanced sampling algorithms like mirostat or tfs_z, and explicit memory controls like keep_alive. However, keep_alive already defaults to 5 minutes in Ollama anyway, and the average user likely just needs reliable vision capabilities rather than granular manipulation.
The real trade-off here is depth versus reach. By using the OpenAI format, we get a "1 vs. many" multiplier. We write the code once, and Shots Studio instantly supports Ollama, LM Studio, LocalAI, and any other proxy. For users already running Ollama, the setup is completely frictionless they simply append /v1 to their existing localhost URL.
If the long-term vision for Shots Studio genuinely requires those specific low-level Ollama parameters, then sticking exclusively to their native API is the right call. Feel free to close this PR if you want to maintain a strict Ollama-native architecture. I just wanted to provide the path that gives users the most 'Bring Your Own AI' flexibility out of the box.
There was a problem hiding this comment.
I see your point. Yeah okay it makes sense if this allows integration with other proxies aswell. Okay I'll review the Pr in the above order. Thanks
There was a problem hiding this comment.
Glad to hear that works for the project's goals. I have a lot of respect for what you've built here; it's a solid project and I'm happy to be a part of it.
I’m looking forward to seeing how this evolves and I’d be glad to support you in any way I can. Feel free to reach out if you want to discuss new features or if you need help with any specific part of the codebase. Excited for what's next.
AnsahMohammad
left a comment
There was a problem hiding this comment.
Great work,
But instead of a single PR, can we reduce this PR into 3 where :
- Service implementation of logic required for connection with ollama and various APIs
- Integration of this ollama API with rest of the AI services.
- UI changes required for this.
Thanks for your contribution
Thanks for the review. I’ve split the work into 3 stacked PRs as requested: Service implementation for connecting to Ollama/OpenAI-compatible APIs |
Thanks for the response, can you specify the order of PR in which they shall be reviewed. I'm closing this PR as this is stale now. |
|


Hi Ansah Mohammad, thank you for reviewing this contribution.
This PR adds OpenAI-compatible provider support for screenshot AI workflows, including endpoint/model configuration.
Summary
Validation