Geminigen ai

From oyi77/1ai-skills · View interactive version

Geminigen ai is an AI agent skill from the GitHub repository oyi77/1ai-skills. Use when choosing which media-generation provider/model to route a request to — image, video, or TTS — and applying failover + cost discipline. Conceptual router; concrete API calls live in the linked sibling skills.

How to use this skill

Skill file

Geminigen AI — Media Generation Router

⚠️ Scope honesty. This skill defines how to choose and sequence providers. It does not ship a verified unified gateway. The provider/model names below are real public offerings, but there is no single api.geminigen.ai endpoint — each provider has its own SDK/key. Do the actual generation through the sibling skills listed in the matrix, which carry their own (provider-specific) instructions.

When to Use

Trigger phrases:

Use cases:

When NOT to Use

Provider Matrix (real models, provider-specific access)

| Task | Options | Where the real how-to lives |

|---|---|---|

| Text-to-image | Nano Banana Pro, Imagen 4, Flux Kontext, Midjourney, Ideogram, Recraft, Stable Diffusion | image-gen |

| Image/text-to-video | Runway, Kling, Sora, Pika, Seedance, Grok Imagine | video/gen |

| TTS (multilingual) | OmniVoice (600+ langs, local) | voice/omnivoice |

| TTS (free local, retired upstream) | Chatterbox | voice-chatterbox-tts |

Pick primary by quality/latency budget, fallback by availability. Never assume two providers share auth.

Workflow

Routing Pattern (framework-agnostic)

# router.py — pure decision logic, no network calls
from dataclasses import dataclass
from typing import Callable, Literal

Task = Literal["t2i", "i2v", "t2v", "tts"]
ORDER = {
    "t2i": ["nano-banana-pro", "flux-kontext", "imagen-4"],
    "i2v": ["kling", "runway", "seedance"],
    "t2v": ["sora", "veo"],
    "tts": ["omnivoice", "chatterbox"],
}

@dataclass
class Attempt:
    provider: str
    ok: bool
    detail: str = ""

def route(task: Task, call: Callable[[str, dict], str], **kw) -> tuple[str, list[Attempt]]:
    """Try providers in ORDER[task]; `call(provider, kw)` must do the real
    provider-specific generation and return an asset URL/path. Records attempts."""
    log: list[Attempt] = []
    last = None
    for provider in ORDER[task]:
        try:
            url = call(provider, kw)
            log.append(Attempt(provider, True, url))
            return url, log
        except Exception as e:
            last = e
            log.append(Attempt(provider, False, repr(e)))
    raise RuntimeError(f"all providers failed for task={task}: {last}")

The caller supplies call — a thin adapter wrapping whichever provider SDK it holds keys for. This skill owns the ordering and logging, not the transport.

Cost Ledger

Log every attempt regardless of success. Without it you cannot tell whether spend went to good generations or retries:

import csv, datetime

def log_attempts(log: list[Attempt], task: str):
    with open("gen_ledger.csv", "a", newline="") as f:
        for a in log:
            csv.writer(f).writerow([
                datetime.datetime.now(datetime.timezone.utc).isoformat(),
                task, a.provider, a.ok, a.detail,
            ])

Verify Every Asset

Never trust a returned URL alone — download and probe:

curl -sSL "$ASSET_URL" -o clip.mp4
ffprobe -v error -show_entries format=duration,size -of compact clip.mp4
# Expect duration within ±0.2 s of request; size > 100 KB for video

Signed URLs expire; partial uploads happen. Probe before shipping.

Anti-Rationalization Table

| Rationalization | Reality |

|---|---|

| "One unified gateway exists" | It doesn't. Each provider has its own SDK/key. This skill routes; siblings execute. |

| "The URL in the response is fine" | Download and ffprobe it. Signed-URL expiry and partial uploads are common. |

| "I'll batch 50 video calls at once" | Rate limits will eat them. Serialize with jittered backoff. |

| "Cost tracking is for finance" | You'll burn budget on silent retries without a ledger. |

Verification

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.