Skip to content

Instantly share code, notes, and snippets.

View hex-plex's full-sized avatar
📈
Focusing

Somnath Kumar hex-plex

📈
Focusing
View GitHub Profile
@hex-plex
hex-plex / load_balancer.py
Created May 26, 2024 07:54
Load Balancer to spin multiple models with single API interface
from flask import Flask, request, jsonify
import requests
import random
app = Flask(__name__)
endpoints = {
'model_provider/model_1': 'http://0.0.0.0:8001',
'model_provider/model_2': 'http://0.0.0.0:8002',
'model_provider/model_3': 'http://0.0.0.0:8003',