vLLM Transformer (1.0.0)

Download OpenAPI specification:

Simple proxy service for vLLM that contains a plethora of premade tools for parsing and processing content of all kinds. Currently hardcoded to listen at localhost:8080.

Responses

Outside of the listed responses, any upstream responses will currently be directly forwarded from vLLM -> your caller. Additionally, 400 responses are automatically generated from OpenAPI spec, similar to FastAPI.

API Keys

If your instance has a key set, the header Authorization will be directly forwarded to "host" as-is.

Get Started

Download the binary, run somewhere, and simply

http post -ef "http://localhost:8080/nsfw_check" --content-type application/json {
  host: "http://localhost:7771/"
  image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAACCEkxzAAAADklEQVR42mOgAIyCUQAAAkAAAdJZOGAAAAAASUVORK5CYII="
} | table -e

NSFW Check

Check image for NSFW content. This is a fine-grained approach that distinguishes multiple levels of explicit content. Current implementation is roughly based on the MPA film ratings

Score MPA Description
≈ 0.0 NR Irrelevant content
≈ 0.2 G Safe content
≈ 0.4 PG Suggestive Content
≈ 0.6 PG-13 Partial/educational nudity
≈ 0.8 R Nudity
≈ 1.0 NC-17 Pornography
Request Body schema: application/json
required
host
required
string <uri>

vLLM host to POST to

image
required
string <uri>

Image URL to be sent for classification. Can be a public URL or a base64 data URI scheme

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "usage": {
    },
  • "scale": 0.798
}

Prompt Enhance

Upsample prompts for generative inference. Specific behavior depends on the chosen style. Many models have their own unique styles optimized for the training distribution, so check there first if the performance is suboptimal!

Request Body schema: application/json
required
host
required
string <uri>

vLLM host to POST to

prompt
required
string

Prompt to upsample

style
required
string
Default: "default"
Enum: "default" "ernie" "ernie_cn" "flux2" "flux2_img" "ideogram4" "krea2_img" "ltx2" "ltx2_img"

Influences how the prompt will be upsampled. If your model is in the list, it's strongly recommended to use that!

Style Description
default Our own default style that handles most cases
ernie Baidu Ernie's default prompt
ernie_cn Baidu Ernie's default prompt, with result translated to chinese
flux2 FLUX.2 text-to-prompt enhancement
flux2_img FLUX.2 image editing
ideogram4 Ideogram4 text-to-json prompting
krea2_img Krea2 image description
ltx2 LTX-2 video generation with audio
ltx2_img LTX-2 image-to-video
image
string or null <uri>

Image URL to be used as a reference for prompt generation. Can be a public URL or a base64 data URI scheme

temperature
required
number <double> [ 0 .. 3 ]
Default: 1

Temperature used for sampling. Higher values result in more creative but may be less stable and hallucinate more. Use 1.0 to get the model's native distribution.

reasoning
required
boolean
Default: false

Enable reasoning when performing the prompt upsample. This will increase generation time and may reduce creativity, but could make the output more accurate to the inputs.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "usage": {
    },
  • "enhanced_prompt": "{\"high_level_description\":\"A photograph of a ginger tabby cat holding a small cardboard sign that reads 'BEAUTIFUL DAY'.\",\"compositional_deconstruction\":{\"background\":\"A sun-drenched wooden porch with weathered grey planks and a small patch of green clover grass visible in the upper-left corner, illuminated by bright midday sunlight.\",\"elements\":[{\"type\":\"obj\",\"desc\":\"A fluffy ginger tabby cat with white paws and a pink nose, sitting upright on its haunches, holding a small piece of brown corrugated cardboard between its two front paws.\"},{\"type\":\"text\",\"text\":\"BEAUTIFUL DAY\",\"desc\":\"Hand-written text in thick black permanent marker on the cardboard sign, centered with slightly uneven lettering, held at chest height by the cat.\"}]}}"
}