Skip to content
Merged
Changes from 2 commits
Commits
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
27 changes: 27 additions & 0 deletions endpoints/OAI/router.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
from fastapi import APIRouter, Depends, HTTPException, Request
from fastapi.responses import JSONResponse
from sse_starlette import EventSourceResponse
from sys import maxsize

Expand Down Expand Up @@ -29,6 +30,7 @@

api_name = "OAI"
router = APIRouter()

urls = {
"Completions": "http://{host}:{port}/v1/completions",
"Chat completions": "http://{host}:{port}/v1/chat/completions",
Expand Down Expand Up @@ -166,3 +168,28 @@ async def embeddings(request: Request, data: EmbeddingsRequest) -> EmbeddingsRes
)

return response

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The route should be in endpoints/core since those are propagated across all API servers.

@router.get("/.well-known/serviceinfo")
async def service_info():
return JSONResponse(content={
"version": 0.2,
"software": {
"name": "TabbyAPI",
"repository": "https://github.com/theroyallab/tabbyAPI",
"homepage": "https://github.com/theroyallab/tabbyAPI",
},
"api": {
"openai": {
"name": "OpenAI API",
"relative_url": "/v1",
"documentation": "https://theroyallab.github.io/tabbyAPI",
"version": 1
},
"koboldai": {
"name": "KoboldAI API",
"relative_url": "/api",
"documentation": "https://theroyallab.github.io/tabbyAPI",
"version": 1
}
}
})