Skip to content

Create GET /list_models endpoint#2160

Open
leeclemnet wants to merge 9 commits intomainfrom
feat/list-models-endpoint
Open

Create GET /list_models endpoint#2160
leeclemnet wants to merge 9 commits intomainfrom
feat/list-models-endpoint

Conversation

@leeclemnet
Copy link
Contributor

@leeclemnet leeclemnet commented Mar 25, 2026

What does this PR do?

Feature request context: https://roboflow.slack.com/archives/C08QA59S0F5/p1774456007394369?thread_ts=1774358265.798339&cid=C08QA59S0F5

Korryn is making a page that lists models for users as a top level item in the nav bar that ships Friday.

those listed models are immediately deployable, ie a user can copy/paste a code snippet and that provides model responses with their API key included.

to have models on this page, we need a list of which models are available on serverless so a user can copy/paste a code snippet that works for them.

Currently there is no convenient way to enumerate all model HTTP endpoints available to a given user. This PR adds a new inference server endpoint GET /list_models?api_key={api_key} which accepts an API key and lists the HTTP endpoints for all generic models, registered public model aliases, and any private models endpoints available via the provided API key.

For HTTP endpoints of the form /infer/{task_type}?model_id={model_id}... the model_ids are pre-populated but need to add the api_key and other required request data to form a complete request.

There are several discovery methods to handle different cases

  1. Core model routes (CLIP, SAM, etc.) via GENERIC_MODELS prefix matching against registered app routes.
  2. GENERIC_MODELS entries whose task type maps to an /infer/* route (e.g. qwen3.5 → /infer/lmm).
  3. Public aliased models with task types resolved via get_model_type, deduplicated by dataset.
  4. Private workspace models fetched via get_roboflow_workspace_models using the caller's API key.

Note: Originally we thought we could do this simply by querying the model_registry, but unfortunately the registry contains model_types not model_ids so it's no good for constructing HTTP requests. However, we do still need to filter /infer/* routes against the model registry in case certain model types are disabled via env vars.

Related Issue(s):

Type of Change

  • New feature (non-breaking change that adds functionality)

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

Tested with my own prod API key against local server running roboflow/roboflow-inference-server-gpu:1.1.2, verified the discovered core model endpoints cover everything in /openapi.json.

{
  "public_endpoints": [
    "http://localhost:9001/clip/compare",
    "http://localhost:9001/clip/embed_image",
    "http://localhost:9001/clip/embed_text",
    "http://localhost:9001/doctr/ocr",
    "http://localhost:9001/easy_ocr/ocr",
    "http://localhost:9001/gaze/gaze_detection",
    "http://localhost:9001/grounding_dino/infer",
    "http://localhost:9001/infer/classification?model_id=resnet18",
    "http://localhost:9001/infer/classification?model_id=resnet34",
    "http://localhost:9001/infer/classification?model_id=resnet50",
    "http://localhost:9001/infer/classification?model_id=resnet101",
    "http://localhost:9001/infer/depth-estimation?model_id=depth-anything-v2",
    "http://localhost:9001/infer/depth-estimation?model_id=depth-anything-v3",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8n-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8n-seg-1280",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8s-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8s-seg-1280",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8m-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8m-seg-1280",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8l-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8l-seg-1280",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8x-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov8x-seg-1280",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov11n-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov11s-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov11m-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov11l-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov11x-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo11n-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo11s-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo11m-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo11l-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo11x-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-preview",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-nano",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-small",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-medium",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-large",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-xlarge",
    "http://localhost:9001/infer/instance_segmentation?model_id=rfdetr-seg-2xlarge",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov26n-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov26s-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov26m-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov26l-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolov26x-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo26n-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo26s-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo26m-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo26l-seg-640",
    "http://localhost:9001/infer/instance_segmentation?model_id=yolo26x-seg-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov8n-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov8s-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov8m-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov8l-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov8x-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov8x-pose-1280",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov26n-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov26s-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov26m-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov26l-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolov26x-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolo26n-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolo26s-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolo26m-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolo26l-pose-640",
    "http://localhost:9001/infer/keypoints_detection?model_id=yolo26x-pose-640",
    "http://localhost:9001/infer/lmm?model_id=smolvlm2",
    "http://localhost:9001/infer/lmm?model_id=moondream2",
    "http://localhost:9001/infer/lmm?model_id=qwen3_5-0.8b",
    "http://localhost:9001/infer/lmm?model_id=qwen3_5-2b",
    "http://localhost:9001/infer/lmm?model_id=qwen25-vl-7b",
    "http://localhost:9001/infer/lmm?model_id=qwen3vl-2b-instruct",
    "http://localhost:9001/infer/object_detection?model_id=grounding_dino",
    "http://localhost:9001/infer/object_detection?model_id=yolo_world",
    "http://localhost:9001/infer/object_detection?model_id=owlv2",
    "http://localhost:9001/infer/object_detection?model_id=yolov8n-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov8n-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov8s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov8s-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov8m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov8m-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov8l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov8l-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov8x-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov8x-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolo-nas-s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo-nas-m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo-nas-l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov10n-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov10s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov10m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov10b-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov10l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov10x-640",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-mix-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-mix-448",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-cococap-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-screen2words-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-vqav2-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-tallyqa-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-docvqa-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-ocrvqa-224",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-cococap-448",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-screen2words-448",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-vqav2-448",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-tallyqa-448",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-docvqa-448",
    "http://localhost:9001/infer/object_detection?model_id=paligemma-3b-ft-ocrvqa-448",
    "http://localhost:9001/infer/object_detection?model_id=florence-2-base",
    "http://localhost:9001/infer/object_detection?model_id=florence-2-large",
    "http://localhost:9001/infer/object_detection?model_id=yolov11n-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov11s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov11m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov11l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov11x-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov11n-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov11s-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov11m-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov11l-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolov11x-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolo11n-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo11s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo11m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo11l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo11x-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo11n-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolo11s-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolo11m-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolo11l-1280",
    "http://localhost:9001/infer/object_detection?model_id=yolo11x-1280",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-base",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-nano",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-small",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-medium",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-large",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-xlarge",
    "http://localhost:9001/infer/object_detection?model_id=rfdetr-2xlarge",
    "http://localhost:9001/infer/object_detection?model_id=yolov26n-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov26s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov26m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov26l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolov26x-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo26n-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo26s-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo26m-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo26l-640",
    "http://localhost:9001/infer/object_detection?model_id=yolo26x-640",
    "http://localhost:9001/ocr/trocr",
    "http://localhost:9001/owlv2/infer",
    "http://localhost:9001/perception_encoder/compare",
    "http://localhost:9001/perception_encoder/embed_image",
    "http://localhost:9001/perception_encoder/embed_text",
    "http://localhost:9001/sam/embed_image",
    "http://localhost:9001/sam/segment_image",
    "http://localhost:9001/sam2/embed_image",
    "http://localhost:9001/sam2/segment_image",
    "http://localhost:9001/sam3/concept_segment",
    "http://localhost:9001/sam3/embed_image",
    "http://localhost:9001/sam3/visual_segment",
    "http://localhost:9001/sam3_3d/infer",
    "http://localhost:9001/yolo_world/infer"
  ],
  "private_endpoints": [
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/aerial-plane-detection/1",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/chess-pieces-mjzgj-v3mep/1",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/chess-pieces-mjzgj-v3mep/2",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/chess-pieces-mjzgj-v3mep/3",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/chess-pieces-mjzgj-v3mep/4",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/chess-pieces-mjzgj-v3mep/5",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/cubicasa5k-2-qpmsa-zyarl/1",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/cubicasa5k-2-qpmsa-zyarl/2",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/sign-language-sokdr-j1ne3/1",
    "http://localhost:9001/infer/object_detection?model_id=lee-sandbox/sign-language-sokdr-j1ne3/2",
    "http://localhost:9001/infer/semantic_segmentation?model_id=lee-sandbox/deep-lab-v3-plus/1",
    "http://localhost:9001/infer/semantic_segmentation?model_id=lee-sandbox/deep-lab-v3-plus/2",
    "http://localhost:9001/infer/semantic_segmentation?model_id=lee-sandbox/deep-lab-v3-plus/3"
  ]
}

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

@leeclemnet leeclemnet force-pushed the feat/list-models-endpoint branch from cec2370 to 7161886 Compare March 25, 2026 17:56
@leeclemnet leeclemnet force-pushed the feat/list-models-endpoint branch from dd0ad0d to 4b0b9b3 Compare March 25, 2026 19:29
@leeclemnet leeclemnet force-pushed the feat/list-models-endpoint branch from 810b152 to 82790ad Compare March 25, 2026 19:45
@leeclemnet leeclemnet force-pushed the feat/list-models-endpoint branch from 6e6cdc3 to 1606080 Compare March 25, 2026 20:04
@leeclemnet leeclemnet changed the title Create /list_models endpoint Create GET /list_models endpoint Mar 25, 2026
@leeclemnet leeclemnet marked this pull request as ready for review March 25, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant