Skip to main content
AI tutorials

Run the Media Inference Worker Test Client Safely

This tutorial explains how to install and run media-inference-worker, an old test client from a media pipeline. You will learn the documented command format, where to find additional request examples, and how to handle the repository’s potentially outdated service-account credentials safely.

Run the Media Inference Worker Test Client Safely

What Is media-inference-worker?

media-inference-worker is an old test client copied from a media pipeline. Its main documented example uses generate.py to submit a text prompt to an image-generation endpoint or model identified as qwen-image-3.

The repository warns that its service account was active when the project was copied, but the remaining credit and key-rotation status are unknown.

Because this is a legacy test client, treat its configuration and credentials as potentially outdated. Review the source and account settings before sending requests or using the client in any shared or production environment.

Key Features

  • Provides a Python script named generate.py for submitting a generation request.
  • Accepts an endpoint or model identifier and a text prompt from the command line.
  • Includes Python dependencies in requirements.txt.
  • Documents additional endpoints and raw request examples in RUNBOOK.md.

Installation and Setup

1. Review the repository first

Open the project locally and inspect generate.py, requirements.txt, and RUNBOOK.md. The README does not explain where credentials are stored or how authentication is configured, so verify those details in the project files before running the client.

2. Check the service-account credentials

Do not assume the copied key is still valid or authorized for your use. If you control the associated account, confirm its status, available credit, permissions, and billing limits. Rotate or revoke exposed or unnecessary credentials before continuing.

3. Create an isolated Python environment

Using a virtual environment is a practical way to keep the client’s dependencies separate from other Python projects.

python -m venv .venv
source .venv/bin/activate

On Windows, activate the environment with:

.venv\Scripts\activate

4. Install the dependencies

From the repository root, install the packages listed by the project:

pip install -r requirements.txt

Basic Usage

The README provides the following generation example:

python generate.py qwen-image-3 "Editorial portrait, hard flash, 35mm grain"

In this command, generate.py is the client script, qwen-image-3 is the request’s endpoint or model identifier, and the quoted text is the generation prompt.

Keep prompts in quotation marks when they contain spaces or punctuation. For example, the documented prompt asks for an editorial portrait with hard flash and a 35 mm grain aesthetic.

Understanding the command structure

python generate.py <endpoint-or-model> "<prompt>"

This structure is inferred from the single example in the README. Before substituting other values, inspect generate.py or consult RUNBOOK.md to confirm which identifiers and arguments the client supports.

Working with Other Endpoints

The README states that other endpoints and raw requests are documented in RUNBOOK.md. Use that file as the project-specific reference when you need to test something beyond the basic qwen-image-3 example.

  1. Open RUNBOOK.md.
  2. Locate the relevant endpoint or raw request example.
  3. Verify that its authentication details and request format are still current.
  4. Check expected costs or credit usage before submitting the request.
  5. Run the smallest practical test before attempting repeated or larger workloads.

Advanced Tips and Safety Practices

Inspect requests before execution

Because the repository is described as an old client, review how generate.py constructs and sends requests. Confirm the destination, payload, authentication method, and any file-writing behavior before executing it.

Avoid relying on copied credentials

Use credentials that you are authorized to access and manage. Do not commit secrets to source control, publish them in logs, or assume that an account mentioned in an old README remains safe to use.

Validate endpoint availability

Legacy endpoint names, request schemas, or keys may no longer work. If the documented command fails, compare the implementation with RUNBOOK.md and verify the current account configuration rather than repeatedly retrying a potentially billable request.

Keep tests controlled

Unknown remaining credit is an explicit concern in the README. Monitor usage and billing where possible, begin with a single request, and avoid automated loops until you understand the client’s behavior and cost.

Conclusion

media-inference-worker offers a minimal Python test client for the old media pipeline. Install its requirements, review its authentication setup, and run the documented qwen-image-3 example only after confirming authorization and credit status. For additional endpoints and lower-level request examples, consult RUNBOOK.md.