Skip to content

Instantly share code, notes, and snippets.

@316usman
316usman / api_server_with_auth.py
Created March 27, 2024 18:20 — forked from aleksandr-smechov/api_server_with_auth.py
vLLM FastAPI server with very basic auth
# Adapted from
# https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/serve/openai_api_server.py
import argparse
import asyncio
import json
import os
import time
from http import HTTPStatus
from typing import AsyncGenerator, Dict, List, Optional, Tuple, Union