Skip to main content

Overview

The Models endpoint provides information about available models on the server. It follows the OpenAI API specification.

Endpoint

GET http://localhost:8000/v1/models

Request

No parameters required.
curl http://localhost:8000/v1/models

Response

Response Body

{
  "object": "list",
  "data": [
    {
      "id": "gpt-3.5-turbo",
      "object": "model",
      "created": 1677610602,
      "owned_by": "owner",
      "root": null,
      "parent": null,
      "permission": null
    }
  ]
}

Response Fields

object
string
Always "list" for this endpoint
data
array
Array of model objects
data[].id
string
Model identifier (currently always "gpt-3.5-turbo")
data[].object
string
Object type: "model"
data[].created
integer
Unix timestamp of when the model information was created
data[].owned_by
string
Entity that owns the model (default: "owner")
data[].root
string | null
Root model identifier (currently null)
data[].parent
string | null
Parent model identifier (currently null)
data[].permission
array | null
Model permissions (currently null)

Python Example

Using requests

import requests

response = requests.get("http://localhost:8000/v1/models")
models = response.json()

print(f"Available models: {len(models['data'])}")
for model in models['data']:
    print(f"- {model['id']}")

Using OpenAI SDK

import openai

# Configure client
openai.api_base = "http://localhost:8000/v1"
openai.api_key = "none"

# List models
models = openai.Model.list()

for model in models.data:
    print(f"Model ID: {model.id}")
    print(f"Created: {model.created}")
    print(f"Owned by: {model.owned_by}")

JavaScript Example

fetch('http://localhost:8000/v1/models')
  .then(response => response.json())
  .then(data => {
    console.log('Available models:');
    data.data.forEach(model => {
      console.log(`- ${model.id}`);
    });
  });

cURL Example

curl http://localhost:8000/v1/models \
  -H "Content-Type: application/json"

Notes

  • The endpoint currently returns a single model entry with ID "gpt-3.5-turbo" regardless of which Qwen model is loaded
  • This is for OpenAI API compatibility - the actual model serving requests is the Qwen model specified when starting the server
  • The created timestamp is generated at request time
  • The model list does not reflect the actual checkpoint path used to start the server

Model Information

To determine which Qwen model is actually running, check the server startup logs:
python openai_api.py --checkpoint-path Qwen/Qwen-7B-Chat
The server will load the model specified in --checkpoint-path, but the API will report it as "gpt-3.5-turbo" for compatibility.

Build docs developers (and LLMs) love