Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
80e60a5
feat: Add model feature in Launch Model list
yiboyasss Sep 26, 2025
0eab739
fix: detail
yiboyasss Sep 26, 2025
3f859be
fix: login dialog
yiboyasss Oct 20, 2025
542abc5
fix: detail
yiboyasss Oct 20, 2025
668502f
FEAT:add model backend
OliverBryant Oct 22, 2025
3cc4aa1
FEAT:add model backend
OliverBryant Oct 22, 2025
79ad0d0
remove model_specs verify
OliverBryant Oct 22, 2025
424ec5e
model_size_in_billions
OliverBryant Oct 23, 2025
05a7b06
fix: frontend
yiboyasss Oct 23, 2025
43bfd12
fix: detail
yiboyasss Oct 23, 2025
6dd1dcd
Function 1: Add a specific model from ModelHub
OliverBryant Oct 24, 2025
52d61e6
Function 1: Add a specific model from ModelHub
OliverBryant Oct 24, 2025
bb029ad
Function 2: One-Click Model Update
OliverBryant Oct 24, 2025
d332f4b
fix: frontend
yiboyasss Oct 24, 2025
05b1804
fix: request bug
yiboyasss Oct 27, 2025
77b7e90
Function 2: One-Click Model Update
OliverBryant Oct 27, 2025
43bf76e
Function 2: One-Click Model Update
OliverBryant Oct 27, 2025
60e6aba
flake8 black isort
OliverBryant Oct 27, 2025
5c40285
mypy
OliverBryant Oct 27, 2025
9b56f30
single json
OliverBryant Oct 28, 2025
071fcfd
remove builtin.py
OliverBryant Oct 29, 2025
57285ae
add model and update model type to worker
OliverBryant Oct 31, 2025
37d0b77
add model and update model type to worker
OliverBryant Oct 31, 2025
04e7e50
remove unregister_model
OliverBryant Oct 31, 2025
8df104a
num1
OliverBryant Oct 31, 2025
5d4aefc
num2:llm
OliverBryant Nov 1, 2025
0199099
num2
OliverBryant Nov 1, 2025
e7d49c5
Fix CI errors
OliverBryant Nov 2, 2025
373cf5c
DOC: model addition and update features
yiboyasss Oct 31, 2025
3cbc118
DOC: update
yiboyasss Oct 31, 2025
6946240
DOC: update
yiboyasss Oct 31, 2025
1566afb
DOX: update
yiboyasss Nov 3, 2025
d6c78f1
update model type
OliverBryant Nov 3, 2025
5bc7a73
add model new complement
OliverBryant Nov 5, 2025
149bad3
add model new complement
OliverBryant Nov 5, 2025
cdd39ae
fix: frontend
yiboyasss Nov 5, 2025
01432f1
add model modify
OliverBryant Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/source/_static/model_update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
413 changes: 413 additions & 0 deletions doc/source/locale/zh_CN/LC_MESSAGES/models/model_update.po

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/source/models/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ Model Usage
model_abilities/index
builtin/index
custom
model_update
sources/sources
virtualenv
lora
Expand Down
165 changes: 165 additions & 0 deletions doc/source/models/model_update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
.. _model_update:

============
Model Update
============
.. versionadded:: v1.13.0

This section briefly introduces two common operations on the "Launch Model" page: updating model lists and adding models. They correspond to the "Type Selection + Update" and "Add Model" buttons at the top of the page, facilitating quick refresh of models of a certain type or adding new models locally.

.. raw:: html

<img class="align-center" alt="model update interface" src="../_static/model_update.png" style="background-color: transparent", width="95%">

Update Models (Launch Model Page)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Operation Location: "Type Selection" dropdown and "Update" button at the top right of the page.
- Usage:
1. Select a model type from the dropdown (such as llm, embedding, rerank, image, audio, video).
2. Click the "Update" button, the page will send an update request to the backend, then automatically jump to the corresponding Tab and refresh the model list of that type.

Add Model (Launch Model Page)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Operation Location: "Add Model" button at the top right of the page.
- Usage:
1. Click "Add Model" to open the add dialog.
2. Complete the model addition process in the dialog.
3. After successful addition, the page will jump to the corresponding type Tab to immediately view the latest model list.

Xinference Models Hub User Guide
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Overview
--------

Xinference Models Hub is a full-stack platform for managing and sharing models.
It provides a comprehensive solution for model registration, browsing, review workflows, and collaborative model management.

You can visit the Models Hub at: https://model.xinference.io

Quick Start
-----------

User Registration and Login
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Registration**

1. Open the website registration page
2. Fill in the necessary information and submit

**Login**

1. Open the website login page
2. After successful login, you will be redirected to the model list page

**Password Reset**

1. Click the "Forgot Password" link on the login page
2. Follow the instructions in the email to reset your password

**Logout**

1. Click the avatar in the top right corner of the page
2. Select "Logout" from the dropdown menu

Core Features
-------------

Browse Models
^^^^^^^^^^^^^

**Model List (Homepage)**

* **Function:** Browse available models, click any model to view details
* **Location:** "Models" menu in the website navigation bar

.. note::
Some advanced models are only visible to authorized users.

**Model Details and Documentation**

* **Function:** View detailed information about models
* **Default Display:** "README" tab - view model description, usage instructions, and notes
* **Other Tabs:** Settings (authorized users), review status

User Center
^^^^^^^^^^^

* **Function:** View and manage personal information
* **Location:** Click the avatar in the top right corner, select "User Center"
* **Content:** Personal profile settings

Model Management (Authorized Users)
-----------------------------------

Model Registration
^^^^^^^^^^^^^^^^^^

* **Function:** Submit new models to the platform
* **Location:** Click the avatar in the top right corner, select "Model Registration"
* **Required Permissions:**

* **Private Models:** Model registration permission
* **Public Models:** Public model registration permission
* **Enterprise Models:** Enterprise model registration permission

**Operation Process:**

1. Fill in basic model information
2. Fill in Readme (can be automatically obtained by clicking the Get Readme button)
3. Submit (to register public models, enable the Public Model parameter)

**Notes:**

* Regular users can only register private models
* Public model registration requires review, and can be used publicly after approval (no review needed if you have public model registration permission)
* Enterprise model registration requires enabling the Public Model parameter first

My Models
^^^^^^^^^

* **Function:** View models associated with your account (models you registered)
* **Location:** Click the avatar in the top right corner, select "My Models"
* **Required Permissions:**

* **Private Models:** Model registration permission
* **Public Models:** Model registration permission
* **Enterprise Models:** Model registration permission

Model Maintenance
^^^^^^^^^^^^^^^^^

* **Function:** Modify and manage existing models
* **Location:** Click the "Settings" icon on the model details page

* **Permission Requirements:**

* **Private Models:** Model ownership or any public model management permission
* **Advanced Models:** Advanced model update, delete, or expiration permission
* **Public Models:** Public model update, delete, or expiration permission

**Notes:**

* Updating JSON or modifying expiration attributes of public models will automatically create a PR to the xorbitsai/inference repository

Review Workflow
^^^^^^^^^^^^^^^

**For Model Submitters:**

1. Submit models for review
2. Check review status on the model details page
3. Make modifications based on reviewer feedback if needed

**For Reviewers:**

* **Required Permissions:** Model review list permission, model review permission

**Operation Process:**

1. Enter the review queue page
2. Evaluate model quality and compliance
3. Approve or reject and provide feedback
122 changes: 122 additions & 0 deletions xinference/api/restful_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ class RegisterModelRequest(BaseModel):
persist: bool


class AddModelRequest(BaseModel):
model_name: str


class UpdateModelRequest(BaseModel):
model_type: str


class BuildGradioInterfaceRequest(BaseModel):
model_type: str
model_name: str
Expand Down Expand Up @@ -900,6 +908,26 @@ async def internal_exception_handler(request: Request, exc: Exception):
else None
),
)
self._router.add_api_route(
"/v1/models/add",
self.add_model,
methods=["POST"],
dependencies=(
[Security(self._auth_service, scopes=["models:add"])]
if self.is_authenticated()
else None
),
)
self._router.add_api_route(
"/v1/models/update_type",
self.update_model_type,
methods=["POST"],
dependencies=(
[Security(self._auth_service, scopes=["models:add"])]
if self.is_authenticated()
else None
),
)
self._router.add_api_route(
"/v1/cache/models",
self.list_cached_models,
Expand Down Expand Up @@ -3123,25 +3151,119 @@ async def unregister_model(self, model_type: str, model_name: str) -> JSONRespon
raise HTTPException(status_code=500, detail=str(e))
return JSONResponse(content=None)

async def add_model(self, request: Request) -> JSONResponse:
try:
# Parse request
raw_json = await request.json()
body = AddModelRequest.parse_obj(raw_json)
model_name = body.model_name

supervisor_ref = await self._get_supervisor_ref()

# Call supervisor with model_name only
await supervisor_ref.add_model(model_name)

# Get model type information to return to frontend
import requests

try:
info_url = f"https://model.xinference.io/api/models/{model_name}"
info_response = requests.get(info_url, timeout=30)
if info_response.status_code == 200:
model_info = info_response.json()
model_type = model_info.get("data", {}).get("model_type")
model_data = model_info.get("data", {}).get("model_data", {})
else:
model_type = "unknown"
model_data = {}
except Exception:
model_type = "unknown"
model_data = {}

except ValueError as re:
logger.error(f"ValueError in add_model API: {re}", exc_info=True)
logger.error(f"ValueError details: {type(re).__name__}: {re}")
raise HTTPException(status_code=400, detail=str(re))
except Exception as e:
logger.error(f"Unexpected error in add_model API: {e}", exc_info=True)
logger.error(f"Error details: {type(e).__name__}: {e}")
import traceback

logger.error(f"Full traceback: {traceback.format_exc()}")
raise HTTPException(status_code=500, detail=str(e))

response_data = {
"success": True,
"message": f"Model added successfully: {model_name}",
"data": {
"model_name": model_name,
"model_type": model_type,
"model_version": model_data.get("version"),
"model_ability": model_data.get("model_ability", []),
"model_family": model_data.get("model_family"),
},
}

return JSONResponse(content=response_data)

async def update_model_type(self, request: Request) -> JSONResponse:
try:
# Parse request
raw_json = await request.json()

body = UpdateModelRequest.parse_obj(raw_json)
model_type = body.model_type

# Get supervisor reference
supervisor_ref = await self._get_supervisor_ref()

await supervisor_ref.update_model_type(model_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


except ValueError as re:
logger.error(f"ValueError in update_model_type API: {re}", exc_info=True)
raise HTTPException(status_code=400, detail=str(re))
except Exception as e:
logger.error(
f"Unexpected error in update_model_type API: {e}", exc_info=True
)
raise HTTPException(status_code=500, detail=str(e))

return JSONResponse(
content={
"message": f"Model configurations updated successfully for type: {model_type}"
}
)

async def list_model_registrations(
self, model_type: str, detailed: bool = Query(False)
) -> JSONResponse:
try:

data = await (await self._get_supervisor_ref()).list_model_registrations(
model_type, detailed=detailed
)

# Remove duplicate model names.
model_names = set()
final_data = []
for item in data:
if item["model_name"] not in model_names:
model_names.add(item["model_name"])
final_data.append(item)

return JSONResponse(content=final_data)
except ValueError as re:
logger.error(
f"ValueError in list_model_registrations: {re}",
exc_info=True,
)
logger.error(re, exc_info=True)
raise HTTPException(status_code=400, detail=str(re))
except Exception as e:
logger.error(
f"Unexpected error in list_model_registrations: {e}",
exc_info=True,
)
logger.error(e, exc_info=True)
raise HTTPException(status_code=500, detail=str(e))

Expand Down
Loading
Loading