From 659ee72bd81511124138a92a4be1464cf5147f17 Mon Sep 17 00:00:00 2001 From: Jun Siang Cheah Date: Thu, 16 Apr 2026 23:43:35 +0100 Subject: [PATCH] remove unused mistral client and pin dependencies mistralai 2.x moved the Mistral class out of the top-level package, breaking the daily CI run. The client was instantiated but never used, so drop it along with the unused rate_limited_mistral_chat helper, and pin remaining deps to avoid future surprise upgrades. --- src/pull_available_models.py | 19 ------------------- src/requirements.txt | 9 ++++----- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/pull_available_models.py b/src/pull_available_models.py index 4c0c2c1..058dbba 100644 --- a/src/pull_available_models.py +++ b/src/pull_available_models.py @@ -7,7 +7,6 @@ import requests import os from dotenv import load_dotenv from google.cloud import cloudquotas_v1 -from mistralai import Mistral from concurrent.futures import ThreadPoolExecutor import time import re @@ -23,10 +22,6 @@ from data import ( load_dotenv() script_dir = os.path.dirname(os.path.abspath(__file__)) -# Global clients -mistral_client = Mistral(api_key=os.environ["MISTRAL_API_KEY"]) -last_mistral_request_time = 0 - def create_logger(provider_name): logger = logging.getLogger(provider_name) @@ -485,20 +480,6 @@ def fetch_lambda_models(logger): return ret_models -def rate_limited_mistral_chat(client, **kwargs): - global last_mistral_request_time - - # Ensure at least 1 second between requests - current_time = time.time() - time_since_last = current_time - last_mistral_request_time - if time_since_last < 1: - time.sleep(1 - time_since_last) - - response = client.chat.complete(**kwargs) - last_mistral_request_time = time.time() - return response - - def fetch_samba_models(logger): logger.info("Fetching SambaNova models...") r = requests.get("https://cloud.sambanova.ai/api/pricing") diff --git a/src/requirements.txt b/src/requirements.txt index 532c7e0..3026c6f 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,5 +1,4 @@ -requests -python-dotenv -google-cloud-quotas -mistralai -beautifulsoup4 \ No newline at end of file +requests==2.33.1 +python-dotenv==1.2.2 +google-cloud-quotas==0.6.0 +beautifulsoup4==4.14.3