Skip to content

Instantly share code, notes, and snippets.

@316usman
316usman / Dumb Test.py
Created March 10, 2025 06:57
Dumb Test
def do_stuff(text):
words = text.split(' ')
# Convert all words to lowercase
words = [word.lower() for word in words]
# Trim spaces (though split already handles this well)
words = [word.strip() for word in words]
# Reverse the word order
@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