replicate/replicate-model-classifier
TypeScript
Captured source
source ↗replicate/replicate-model-classifier
Description: An HTTP API to classify Replicate models into Hugging Face tasks using a language model.
Language: TypeScript
Stars: 0
Forks: 0
Open issues: 0
Created: 2025-04-01T21:53:15Z
Pushed: 2025-05-17T21:57:55Z
Default branch: main
Fork: no
Archived: no
README:
Replicate Model Classifier
An HTTP API to classify Replicate models into Hugging Face tasks using a language model.
Powered by:
- Cloudflare Workers for hosting the HTTP API
- Hono for authoring the HTTP API
- Anthropic Claude 3.7 Sonnet for model classification
- Replicate API for model metadata
- Hugging Face Tasks for model task metadata
- Cloudflare D1 for caching classifications
Repository: https://github.com/zeke/replicate-model-classifier
API
Base URL: https://replicate-model-classifier.ziki.workers.dev/
Classify a model
GET /api/models/:owner/:model
Returns a JSON object with the model classification. Responses are cached.
Cache Busting
To force a fresh classification and bypass the cache, add the bust=1 query parameter:
GET /api/models/:owner/:model?bust=1
This will skip the cache and trigger a new classification, updating the cache with the latest result.
Example:
/api/models/salesforce/blip?bust=1
Output Format
The response includes a classification object with the following fields:
summary: A short summary of what the model does in 10 words or less. Not a sales pitch.inputTypes: An array of the types of inputs the model accepts, like "text", "image", "audio", etc.outputTypes: An array of the types of outputs the model returns, like "text", "image", "audio", etc.task: The Hugging Face task name the model performs.categories: An array of 5 categories the model belongs to (e.g., "image", "audio", "diffusion").useCases: An array of 10 use cases for the model. Each is a single sentence of 8 words or less.
Example response:
{
"model": "salesforce/blip",
"classification": {
"summary": "Generate image captions and answer questions about images",
"inputTypes": ["image", "text"],
"outputTypes": ["text"],
"task": "visual-question-answering",
"categories": ["image", "captioning", "vision", "qa", "multimodal"],
"useCases": [
"Generate image captions for social media",
"Answer questions about medical images",
"Create alt text for accessibility",
"Analyze security camera footage",
"Describe artwork for museums",
"Generate product descriptions",
"Answer questions about diagrams",
"Create image-based quizzes",
"Analyze satellite imagery",
"Describe scenes in videos"
]
}
}The response includes cache headers:
X-Cache: Either "HIT" or "MISS" to indicate if the response came from cacheCache-Control: "public, max-age=315360000" (10 years)
Examples
- /api/models/bytedance/sdxl-lightning-4step
- /api/models/meta/meta-llama-3-8b-instruct
- /api/models/black-forest-labs/flux-schnell
- /api/models/salesforce/blip
- /api/models/meta/meta-llama-3-70b-instruct
- /api/models/stability-ai/stable-diffusion
- /api/models/abiruyt/text-extract-ocr
- /api/models/tencentarc/gfpgan
- /api/models/andreasjansson/clip-features
- /api/models/stability-ai/sdxl
View the prompt
To get a pretty-printed view of the prompt that was used to classify the model, add the prompt query parameter:
GET /api/models/:owner/:model?prompt=1
Examples
- /api/models/wavespeedai/wan-2.1-i2v-480p?prompt=1
- /api/models/meta/meta-llama-3-8b-instruct?prompt=1
- /api/models/black-forest-labs/flux-schnell?prompt=1
View everything
It can be helpful to see all the data that goes into the model classification. You can see all the data by adding the debug query parameter:
GET /api/models/:owner/:model?debug=1
Examples:
- /api/models/wavespeedai/wan-2.1-i2v-480p?debug=1
- /api/models/meta/meta-llama-3-8b-instruct?debug=1
- /api/models/black-forest-labs/flux-schnell?debug=1
View all classifications
Get all cached model classifications:
GET /api/classifications
Returns a JSON object with all cached classifications:
{
"classifications": [
{
"model": "salesforce/blip",
"classification": {
"summary": "Generate image captions and answer questions about images",
"inputTypes": ["image", "text"],
"outputTypes": ["text"],
"task": "visual-question-answering",
"taskSummary": "Visual Question Answering is the task of answering open-ended questions based on an image. They output natural language responses to natural language questions.",
"useCases": [
"Generate image captions for social media",
"Answer questions about medical images",
"Create alt text for accessibility",
"Analyze security camera footage",
"Describe...Excerpt shown — open the source for the full document.
Notability
notability 5.0/10New tool from Replicate, not a major release.