Skip to content

[Feature] Route slide/figure image generation through Kady's configured providers instead of hardcoded OpenRouter #40

Description

@arsaboo

The scientific-slides skill generates presentation visuals (and full-slide images for the PDF workflow) via generate_slide_image.py / generate_slide_image_ai.py. Those scripts currently hardcode https://openrouter.ai/api/v1 and call google/gemini-3.1-flash-image ("Nano Banana Pro"), with a gemini-3.7-flash review step, and abort (Error: OPENROUTER_API_KEY not found) when no OpenRouter key is present. There's no fallback to any other provider — not Ollama, NVIDIA, or the configured OAuth providers (OpenAI Codex, xAI, Anthropic).

This hardcodes a dependency on OpenRouter for the default slide workflow, even in a BYOK app that otherwise lets users bring their own model access (OpenAI, xAI, NVIDIA NIM, Ollama). Since these scripts run as sandbox subprocesses, they only see process.env — so they can reach OpenRouter (env key) but not OAuth providers (tokens live in Pi's auth store and are correctly never exported into the sandbox).

Here's what I propose (not yet implemented):

  • Add a backend-owned, provider-agnostic image-generation capability (a tool + localhost endpoint, reusing the existing kady-modal/notebook/latex-assist patterns), so credentials stay centralized, budget-gated, and cost-ledgered — and never leak into the sandbox.
  • A provider resolver picks an actually-available image model with a sane fallback order (configured image provider → OpenRouter).
  • Point the skill scripts at that endpoint instead of the hardcoded OpenRouter URL, making OpenRouter optional.

@TKassis let me know what you think about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions