Skip to main content
Glama

gpu_run

Execute AI services including LLM inference, image/video generation, speech processing, and document analysis through a unified GPU compute gateway.

Instructions

Run any GPU-Bridge AI service. 30 services available: LLM inference (sub-second), image generation (FLUX, SD3.5), video generation, video enhancement (up to 4K), speech-to-text (Whisper, <1s), TTS (40+ voices), music generation, voice cloning, embeddings, document reranking (Jina), OCR, PDF/document parsing, NSFW detection, image captioning, visual Q&A, background removal, face restoration, upscaling, stickers, and more. Use gpu_catalog to see all available services.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesService key. Common ones: llm-4090 (text), image-4090 (image), video (video), whisper-l4 (speech-to-text), tts-l4 (text-to-speech), embedding-l4 (embeddings), rembg-l4 (bg removal), upscale-l4 (upscale), ocr (text extraction), caption (image caption), face-restore, musicgen-l4, llava-4090 (visual Q&A), sticker, whisperx (diarized STT), bark (expressive TTS), voice-clone, photomaker, ad-inpaint, animate, image-variation, inpaint, controlnet, clip, segmentation, rerank (document reranking), nsfw-detect (content moderation), video-enhance (video upscaling), pdf-parse (document parsing)
inputYesService-specific input. Examples: LLM {"prompt":"...","max_tokens":512,"model":"llama-3.3-70b-versatile"}, Image {"prompt":"..."}, Whisper {"audio_url":"https://..."}, TTS {"text":"...","voice":"af_alloy"}, Embedding {"text":"..."}, OCR/Rembg/Upscale/Caption {"image_url":"https://..."}, Video {"prompt":"..."}
priorityNoRouting priority. "fast" = lowest latency (default), "cheap" = lowest cost.

Implementation Reference

  • index.js:17-39 (registration)
    Registration of the 'gpu_run' tool, including its description and input schema.
    {
      name: "gpu_run",
      description: "Run any GPU-Bridge AI service. 30 services available: LLM inference (sub-second), image generation (FLUX, SD3.5), video generation, video enhancement (up to 4K), speech-to-text (Whisper, <1s), TTS (40+ voices), music generation, voice cloning, embeddings, document reranking (Jina), OCR, PDF/document parsing, NSFW detection, image captioning, visual Q&A, background removal, face restoration, upscaling, stickers, and more. Use gpu_catalog to see all available services.",
      inputSchema: {
        type: "object",
        properties: {
          service: {
            type: "string",
            description: "Service key. Common ones: llm-4090 (text), image-4090 (image), video (video), whisper-l4 (speech-to-text), tts-l4 (text-to-speech), embedding-l4 (embeddings), rembg-l4 (bg removal), upscale-l4 (upscale), ocr (text extraction), caption (image caption), face-restore, musicgen-l4, llava-4090 (visual Q&A), sticker, whisperx (diarized STT), bark (expressive TTS), voice-clone, photomaker, ad-inpaint, animate, image-variation, inpaint, controlnet, clip, segmentation, rerank (document reranking), nsfw-detect (content moderation), video-enhance (video upscaling), pdf-parse (document parsing)"
          },
          input: {
            type: "object",
            description: 'Service-specific input. Examples: LLM {"prompt":"...","max_tokens":512,"model":"llama-3.3-70b-versatile"}, Image {"prompt":"..."}, Whisper {"audio_url":"https://..."}, TTS {"text":"...","voice":"af_alloy"}, Embedding {"text":"..."}, OCR/Rembg/Upscale/Caption {"image_url":"https://..."}, Video {"prompt":"..."}'
          },
          priority: {
            type: "string",
            enum: ["fast", "cheap"],
            description: 'Routing priority. "fast" = lowest latency (default), "cheap" = lowest cost.'
          }
        },
        required: ["service", "input"]
      }
    },
  • Handler logic for the 'gpu_run' tool, which makes the API call and polls for the job result.
          case "gpu_run": {
            const { service, input, priority } = args;
            const headers = {};
            if (priority) headers["X-Priority"] = priority;
            const job = await apiCall("/run", "POST", { service, input }, headers);
            if (job.error) {
              return { content: [{ type: "text", text: `Error: ${job.error}${job.hint ? `
    Hint: ${job.hint}` : ""}${job.available_services ? `
    Available: ${job.available_services.join(", ")}` : ""}` }], isError: true };
            }
            const result = await pollJob(job.job_id);
            const output = result.output;
            let text;
            if (typeof output === "string") {
              text = output;
            } else if (output?.text) {
              text = output.text;
            } else if (output?.url) {
              text = output.url;
            } else if (output?.audio_url) {
              text = output.audio_url;
            } else if (output?.embedding) {
              text = `Embedding (${output.dimensions} dimensions): [${output.embedding.slice(0, 5).map((n) => n.toFixed(4)).join(", ")}...]`;
            } else {
              text = JSON.stringify(output, null, 2);
            }
            if (result.output_notice) {
              text += `
    
    Note: ${result.output_notice}`;
            }
            return { content: [{ type: "text", text }] };
          }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Adds valuable performance context ('sub-second', '<1s', 'fast' vs 'cheap' routing) but omits critical operational details: authentication requirements, error handling patterns, cost implications, and whether operations are idempotent or destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Information-dense and front-loaded with main purpose. The exhaustive service list (30 items) is necessary given the tool's polymorphic nature. Ends with actionable sibling reference. Efficient sentence structure with minimal filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complex multi-service tool with nested input objects but no output schema. Description comprehensively covers input capabilities and service types but fails to describe return values, error formats, or rate limiting—critical gaps given the absence of structured output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed examples (especially for 'input' object's polymorphic structure). Description adds high-level categorization of services but largely overlaps with schema enumerations; does not significantly augment parameter understanding beyond schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear specific verb (Run) + resource (GPU-Bridge AI service) with explicit scope (30 services). Distinguishes from siblings by directing users to gpu_catalog for discovery while this handles execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly directs users to 'use gpu_catalog to see all available services,' establishing clear workflow (catalog for discovery, run for execution). Could strengthen by noting gpu_estimate/balance for cost checking before execution.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gpu-bridge/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server