Skip to content

Commit

Permalink
upgrade to v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpinDale committed Nov 4, 2024
1 parent 1c9bc2d commit c9ff8ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions endpoints/OAI/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,14 @@

api_name = "OAI"
router = APIRouter()
host = None
port = None

urls = {
"Completions": "http://{host}:{port}/v1/completions",
"Chat completions": "http://{host}:{port}/v1/chat/completions",
}


def setup(server_host: str = None, server_port: int = None):
global host, port
host = server_host
port = server_port
def setup():
return router


Expand Down Expand Up @@ -177,7 +172,7 @@ async def embeddings(request: Request, data: EmbeddingsRequest) -> EmbeddingsRes
@router.get("/.well-known/serviceinfo")
async def service_info():
return JSONResponse(content={
"version": 0.1,
"version": 0.2,
"software": {
"name": "TabbyAPI",
"repository": "https://github.com/theroyallab/tabbyAPI",
Expand All @@ -186,13 +181,13 @@ async def service_info():
"api": {
"openai": {
"name": "OpenAI API",
"base_url": f"http://{host}:{port}/v1",
"relative_url": "/v1",
"documentation": "https://theroyallab.github.io/tabbyAPI",
"version": 1
},
"koboldai": {
"name": "KoboldAI API",
"base_url": f"http://{host}:{port}/api",
"relative_url": "/api",
"documentation": "https://theroyallab.github.io/tabbyAPI",
"version": 1
}
Expand Down
2 changes: 1 addition & 1 deletion endpoints/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setup_app(host: Optional[str] = None, port: Optional[int] = None):
selected_server = router_mapping.get(server.lower())

if selected_server:
app.include_router(selected_server.setup(host, port))
app.include_router(selected_server.setup())

logger.info(f"Starting {selected_server.api_name} API")
for path, url in selected_server.urls.items():
Expand Down

0 comments on commit c9ff8ef

Please sign in to comment.