mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-06 12:40:02 +00:00
Added simple /models endpoint to work with frontends that don't allow bypass check like Openweb-ui
This commit is contained in:
parent
de7e892f72
commit
b1bff2a405
1 changed files with 11 additions and 3 deletions
|
@ -10,8 +10,16 @@ from ktransformers.server.backend.base import BackendInterfaceBase
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
models = [
|
||||||
|
{"id": "0", "name": "ktranformers-model"},
|
||||||
|
]
|
||||||
|
|
||||||
@router.post('/chat/completions',tags=['openai'])
|
@router.get('/models', tags=['openai'])
|
||||||
|
async def list_models():
|
||||||
|
return models
|
||||||
|
|
||||||
|
|
||||||
|
@router.post('/chat/completions', tags=['openai'])
|
||||||
async def chat_completion(request:Request,create:ChatCompletionCreate):
|
async def chat_completion(request:Request,create:ChatCompletionCreate):
|
||||||
id = str(uuid4())
|
id = str(uuid4())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue