From c286038efd1fbeb480d7f9eead7430ead530a052 Mon Sep 17 00:00:00 2001 From: based Date: Mon, 20 May 2024 07:50:42 +1000 Subject: [PATCH] start checking for 0314 32k by default instead don't think anybody cares about 'real' 32k keys that have 0613 anymore, 0314 always was the better model anyway, but we'll still mark them with a flag just in case also brought back the readme --- APIKey.py | 1 + OpenAI.py | 17 ++++++++++------- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/APIKey.py b/APIKey.py index 23fca88..4498bc2 100644 --- a/APIKey.py +++ b/APIKey.py @@ -15,6 +15,7 @@ class APIKey: self.rpm = 0 self.tier = "" self.has_special_models = False + self.real_32k = False self.the_one = False elif provider == Provider.ANTHROPIC: diff --git a/OpenAI.py b/OpenAI.py index 93f1103..3a269bb 100644 --- a/OpenAI.py +++ b/OpenAI.py @@ -2,7 +2,7 @@ import APIKey import asyncio oai_api_url = "https://api.openai.com/v1" -oai_t1_rpm_limits = {"gpt-3.5-turbo": 3500, "gpt-4": 500, "gpt-4-32k": 20} +oai_t1_rpm_limits = {"gpt-3.5-turbo": 3500, "gpt-4": 500, "gpt-4-32k-0314": 20} oai_tiers = {40000: 'Free', 60000: 'Tier1', 80000: 'Tier2', 160000: 'Tier3', 1000000: 'Tier4', 2000000: 'Tier5'} @@ -22,8 +22,9 @@ async def get_oai_model(key: APIKey, session, retries, org=None): if model["id"] == "gpt-4-base": key.the_one = True if model["id"] == "gpt-4-32k": + key.real_32k = True + if model["id"] == "gpt-4-32k-0314": top_model = model["id"] - break elif model["id"] == "gpt-4": top_model = model["id"] key.model = top_model @@ -147,7 +148,7 @@ def pretty_print_oai_keys(keys, cloned_keys): "has_quota": [], "no_quota": [] }, - "gpt-4-32k": { + "gpt-4-32k-0314": { "has_quota": [], "no_quota": [] } @@ -197,8 +198,8 @@ def pretty_print_oai_keys(keys, cloned_keys): + (f" | other orgs - {key.organizations}" if len(key.organizations) > 1 else "") + (f" | key has finetuned models" if key.has_special_models else "")) - print(f'\nValidated {len(key_groups["gpt-4-32k"]["has_quota"])} gpt-4-32k keys with quota:') - for key in key_groups["gpt-4-32k"]["has_quota"]: + print(f'\nValidated {len(key_groups["gpt-4-32k-0314"]["has_quota"])} gpt-4-32k keys with quota:') + for key in key_groups["gpt-4-32k-0314"]["has_quota"]: print(f"{key.api_key}" + (f" | default org - {key.default_org}" if key.default_org else "") + (f" | other orgs - {key.organizations}" if len(key.organizations) > 1 else "") @@ -206,14 +207,16 @@ def pretty_print_oai_keys(keys, cloned_keys): + (" (RPM increased via request)" if check_manual_increase(key) else "") + (f" | TRIAL KEY" if key.trial else "") + (f" | key has finetuned models" if key.has_special_models else "") + + (f" | real 32k key (pre deprecation)" if key.real_32k else "") + (f" | !!!god key!!!" if key.the_one else "")) - print(f'\nValidated {len(key_groups["gpt-4-32k"]["no_quota"])} gpt-4-32k keys with no quota:') - for key in key_groups["gpt-4-32k"]["no_quota"]: + print(f'\nValidated {len(key_groups["gpt-4-32k-0314"]["no_quota"])} gpt-4-32k keys with no quota:') + for key in key_groups["gpt-4-32k-0314"]["no_quota"]: print(f"{key.api_key}" + (f" | default org - {key.default_org}" if key.default_org else "") + (f" | other orgs - {key.organizations}" if len(key.organizations) > 1 else "") + (f" | key has finetuned models" if key.has_special_models else "") + + (f" | real 32k key (pre deprecation)" if key.real_32k else "") + (f" | !!!god key!!!" if key.the_one else "")) if cloned_keys: diff --git a/README.md b/README.md index 55a645f..9525e77 100644 --- a/README.md +++ b/README.md @@ -1 +1,43 @@ -not my problem. simple as. \ No newline at end of file +# keychecker +a fast, bulk key checker for various AI services + +Currently supports and validates keys for the services below, and checks for the listed attributes a key might have: + +- OpenAI - (Best model, key in quota, RPM (catches increase requests), tier, list of organizations if applicable, trial key status) +- Anthropic - (Pozzed status and key tier, along with remaining character quota) +- AI21 - (Trial check) +- Google MakerSuite (List of available models) +- AWS - (Admin status, auto-fetch the region, logging status, username, bedrock status + enabled models) +- Azure - (Auto-fetch all deployments, auto-fetch best deployment/model, filter status, dall-e deployment) +- Google Cloud Vertex AI - (Requires a key file since oauth tokens expire hourly. Good luck scraping for those.) +- MistralAI - (Subscription status) +- OpenRouter - (Estimated balance, usage in $, credit limit, RPM, has purchased any credits) +- ElevenLabs - (Key tier, remaining characters in plan, detect uncapped char quota, pro voice cloning limit, invoice details on pay as you go plans) + +# Usage: +`pip install -r requirements.txt` + +`python main.py` + +# Optional Arguments: + +`-proxyoutput` + +Outputs keys in a format that can be easily copied and pasted into khanon's proxy instead of pretty print + + +`-nooutput` + +Stops outputting and saving keys to the snapshot file (proxyoutput will also do this) + +`-file` + +Reads keys from a file instead of stdin, place either the absolute or relative path to the file in quotes after the flag. + +`-verbose` + +Displays an output as keys are being checked real time. + +`-awslegacy` + +Uses the slower legacy AWS checker (thread parallelized + boto3) instead of the new asynchronous REST API one. \ No newline at end of file