Skip to content

[Feature]: Add /v1/models API endpoint to list models #532

@sammcj

Description

@sammcj

Prerequisites

  • I have searched existing issues and discussions to avoid duplicates

Problem to solve

When /v1/models or /models is queried from clients - bifrost does not return the list of models.

LLM API providers use the /v1/models or /models endpoint to provide clients a list of models. This is often used to populate model drop down lists in client tools.

curl https://bifrost.your.domain/v1/models

<!DOCTYPE html><!--build--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/4cf2300e9c8272f7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/93f479601ee12b01-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/59786e30c3453a61.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-07c7d5bd191e9c71.js"/><script src="/_next/static/chunks/4bd1b696-c023c6e3521b1417.js" async=""></script><script src="/_next/static/chunks/255-2ea93159d9bee7fd.js" async=""></script><script src="/_next/static/chunks/main-app-2ecc3bf42ae2d122.js" async=""></script><script src="/_next/static/chunks/82-9cd62844ea761b4e.js" async=""></script><script src="/_next/static/chunks/194-cf0d37d90654fe28.js" async=""></script><script src="/_next/static/chunks/691-c47bd2fca38cb22d.js" async=""></script><script src="/_next/static/chunks/520-b89056c58a467df4.js" async=""></script><script src="/_next/static/chunks/619-ba102abea3e3d0e4.js" async=""></script><script src="/_next/static/chunks/834-aad6f4e4087827a9.js" async=""></script><script src="/_next/static/chunks/52-9e5c42ee942dd760.js" async=""></script><script src="/_next/static/chunks/522-71a58c8ec82d9bd6.js" async=""></script><script src="/_next/static/chunks/105-dea6bda13558f5ca.js" async=""></script><script src="/_next/static/chunks/app/layout-6bbdae7071e6833f.js" async=""></script><script src="/_next/static/chunks/app/page-16d38047884ba52a.js" async=""></script><meta name="next-size-adjust" content=""/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="32x32"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_188709 __variable_9a8899 antialiased"><div hidden=""><!--$--><!--/$--></div><style>
:root {
  --bprogress-color: #188410;
  --bprogress-height: 4px;
  --bprogress-spinner-size: 18px;
  --bprogress-spinner-animation-duration: 400ms;
  --bprogress-spinner-border-size: 2px;
  --bprogress-box-shadow: 0 0 10px #188410, 0 0 5px #188410;
  --bprogress-z-index: 99999;
  --bprogress-spinner-top: 15px;
  --bprogress-spinner-bottom: auto;
  --bprogress-spinner-right: 15px;
  --bprogress-spinner-left: auto;
}
...

This causes client applications to fail to list models, e.g:

Image

Proposed solution

Add support for the /v1/models standard endpoint for listing models.

For example when doing a curl https://your-server.your.domain/v1/models (with llama-swap, vllm etc...) you should get back something like:

{
  "data": [
    {
      "created": 1759206400,
      "id": "Kimi-Dev-72B-UD-Q3_K_XL-49k",
      "object": "model",
      "owned_by": "llama-swap"
    },
    {
      "created": 1759206400,
      "id": "Mistral-Small-3.2-24B-Instruct-2506-UD-Q5_K_XL-32k",
      "object": "model",
      "owned_by": "llama-swap"
    },
    {
      "created": 1759206400,
      "id": "Mistral-Small-3.2-24B-Instruct-2506-UD-Q5_K_XL-64k",
      "object": "model",
      "owned_by": "llama-swap"
    },
    {
      "created": 1759206400,
      "id": "deepseek-v3.1-terminus-ud-tq1_0-32k",
      "object": "model",
      "owned_by": "llama-swap"
    },
    {
      "created": 1759206400,
      "id": "embeddinggemma-300m-q8_0-2k",
      "object": "model",
      "owned_by": "llama-swap"
    },
    {
      "created": 1759206400,
      "id": "fine-tuned-transcripts-llama3.2-3b-q4km-64k",
      "object": "model",
      "owned_by": "llama-swap"
    }
  ]
}

Another example (Ollama):

{
  "object": "list",
  "data": [
    {
      "id": "embeddinggemma:latest",
      "object": "model",
      "created": 1757628380,
      "owned_by": "library"
    },
    {
      "id": "hf.co/SaisExperiments/granite-4.0-tiny-preview-Q8_0-GGUF:latest",
      "object": "model",
      "created": 1752230934,
      "owned_by": "SaisExperiments"
    },
    {
      "id": "hf.co/unsloth/SmolLM3-3B-128K-GGUF:UD-Q6_K_XL",
      "object": "model",
      "created": 1752203646,
      "owned_by": "unsloth"
    },
    {
      "id": "hf.co/unsloth/Devstral-Small-2507-GGUF:UD-Q6_K_XL",
      "object": "model",
      "created": 1752190437,
      "owned_by": "unsloth"
    }
  ]
}

Alternatives considered

The closest existing issue I could find is #493 but /v1/models (or simply /models) is not a management endpoint.

Area(s)

Transports (HTTP)

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions