ysm 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ysm/__init__.py +1 -0
- ysm/client.py +57 -0
- ysm/keys.py +21 -0
- ysm/models.py +32 -0
- ysm-0.1.5.dist-info/METADATA +4 -0
- ysm-0.1.5.dist-info/RECORD +9 -0
- ysm-0.1.5.dist-info/WHEEL +5 -0
- ysm-0.1.5.dist-info/entry_points.txt +2 -0
- ysm-0.1.5.dist-info/top_level.txt +1 -0
ysm/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .client import EasyRouter
|
ysm/client.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
import sys
|
|
3
|
+
from .models import models
|
|
4
|
+
from .keys import keys
|
|
5
|
+
|
|
6
|
+
class EasyRouter:
|
|
7
|
+
def __init__(self, account_type):
|
|
8
|
+
self._keys = keys
|
|
9
|
+
self.models = models
|
|
10
|
+
self.api_key = self._keys.get(account_type)
|
|
11
|
+
self.url = "https://openrouter.ai/api/v1/chat/completions"
|
|
12
|
+
|
|
13
|
+
def _make_request(self, model_id, messages):
|
|
14
|
+
headers = {
|
|
15
|
+
"Authorization": f"Bearer {self.api_key}",
|
|
16
|
+
"Content-Type": "application/json"
|
|
17
|
+
}
|
|
18
|
+
data = {"model": model_id, "messages": messages}
|
|
19
|
+
response = requests.post(self.url, headers=headers, json=data)
|
|
20
|
+
response.raise_for_status()
|
|
21
|
+
return response.json()['choices'][0]['message']['content']
|
|
22
|
+
|
|
23
|
+
def start_chat(self, model):
|
|
24
|
+
model_id = self.models.get(model)
|
|
25
|
+
history = [{"role": "system", "content": "You are a helpful assistant."}]
|
|
26
|
+
|
|
27
|
+
while True:
|
|
28
|
+
user_input = input("ysm: ")
|
|
29
|
+
if user_input.lower() == 'q':
|
|
30
|
+
break
|
|
31
|
+
|
|
32
|
+
history.append({"role": "user", "content": user_input})
|
|
33
|
+
|
|
34
|
+
print("obla: ", end="", flush=True)
|
|
35
|
+
try:
|
|
36
|
+
answer = self._make_request(model_id, history)
|
|
37
|
+
print(answer + "\n")
|
|
38
|
+
history.append({"role": "assistant", "content": answer})
|
|
39
|
+
except Exception as e:
|
|
40
|
+
print(f"\nError: {e}")
|
|
41
|
+
|
|
42
|
+
def run_cli():
|
|
43
|
+
args = sys.argv[1:]
|
|
44
|
+
|
|
45
|
+
if len(args) == 1 and args[0] == "list":
|
|
46
|
+
for key, value in models.items():
|
|
47
|
+
print(f"{key:>2} {value}")
|
|
48
|
+
sys.exit(0)
|
|
49
|
+
|
|
50
|
+
if len(args) < 2:
|
|
51
|
+
sys.exit(1)
|
|
52
|
+
|
|
53
|
+
api_input = args[0]
|
|
54
|
+
model_input = args[1]
|
|
55
|
+
|
|
56
|
+
app = EasyRouter(account_type=api_input)
|
|
57
|
+
app.start_chat(model=model_input)
|
ysm/keys.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
keys = {
|
|
2
|
+
"a1": "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",
|
|
3
|
+
"a2": "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",
|
|
4
|
+
"a3": "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",
|
|
5
|
+
"a4": "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",
|
|
6
|
+
"a5": "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",
|
|
7
|
+
"a6": "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",
|
|
8
|
+
"a7": "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",
|
|
9
|
+
"a8": "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",
|
|
10
|
+
"a9": "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",
|
|
11
|
+
"g1": "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",
|
|
12
|
+
"g2": "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",
|
|
13
|
+
"g3": "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",
|
|
14
|
+
"g4": "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",
|
|
15
|
+
"g5": "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",
|
|
16
|
+
"g6": "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",
|
|
17
|
+
"g7": "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",
|
|
18
|
+
"g8": "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",
|
|
19
|
+
"g9": "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",
|
|
20
|
+
"g0": "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",
|
|
21
|
+
}
|
ysm/models.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
models = {
|
|
2
|
+
"1": "arcee-ai/trinity-large-preview:free",
|
|
3
|
+
"2": "tngtech/deepseek-r1t2-chimera:free",
|
|
4
|
+
"3": "z-ai/glm-4.5-air:free",
|
|
5
|
+
"4": "stepfun/step-3.5-flash:free",
|
|
6
|
+
"5": "tngtech/deepseek-r1t-chimera:free",
|
|
7
|
+
"6": "nvidia/nemotron-3-nano-30b-a3b:free",
|
|
8
|
+
"7": "deepseek/deepseek-r1-0528:free",
|
|
9
|
+
"8": "tngtech/tng-r1t-chimera:free",
|
|
10
|
+
"9": "openai/gpt-oss-120b:free",
|
|
11
|
+
"10": "qwen/qwen3-coder:free",
|
|
12
|
+
"11": "upstage/solar-pro-3:free",
|
|
13
|
+
"12": "meta-llama/llama-3.3-70b-instruct:free",
|
|
14
|
+
"13": "arcee-ai/trinity-mini:free",
|
|
15
|
+
"14": "qwen/qwen3-next-80b-a3b-instruct:free",
|
|
16
|
+
"15": "openai/gpt-oss-20b:free",
|
|
17
|
+
"16": "nvidia/nemotron-nano-12b-v2-vl:free",
|
|
18
|
+
"17": "nvidia/nemotron-nano-9b-v2:free",
|
|
19
|
+
"18": "google/gemma-3-27b-it:free",
|
|
20
|
+
"19": "cognitivecomputations/dolphin-mistral-24b-venice-edition:free",
|
|
21
|
+
"20": "liquid/lfm-2.5-1.2b-instruct:free",
|
|
22
|
+
"21": "liquid/lfm-2.5-1.2b-thinking:free",
|
|
23
|
+
"22": "mistralai/mistral-small-3.1-24b-instruct:free",
|
|
24
|
+
"23": "nousresearch/hermes-3-llama-3.1-405b:free",
|
|
25
|
+
"24": "google/gemma-3n-e2b-it:free",
|
|
26
|
+
"25": "qwen/qwen3-4b:free",
|
|
27
|
+
"26": "google/gemma-3-12b-it:free",
|
|
28
|
+
"27": "meta-llama/llama-3.2-3b-instruct:free",
|
|
29
|
+
"28": "google/gemma-3-4b-it:free",
|
|
30
|
+
"29": "google/gemma-3n-e4b-it:free",
|
|
31
|
+
"30": "openrouter/free",
|
|
32
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
ysm/__init__.py,sha256=Xi8PetNHt9cpVC4mMF_8x1_c0pdsIo2MlnIV02i8onI,30
|
|
2
|
+
ysm/client.py,sha256=Fnm6dac4ybkw8-IoolbWO_ciUJ_S7S8TpDgQsiDE4N8,1782
|
|
3
|
+
ysm/keys.py,sha256=CZigy3t-YCYoEeSLrepJ1JYBmihvmOZ-FAEh8cwMBWk,1823
|
|
4
|
+
ysm/models.py,sha256=oZa8vuhDrD-ZcL5iCyr7NkT3f0ALJlu377Khy96Rj_4,1587
|
|
5
|
+
ysm-0.1.5.dist-info/METADATA,sha256=egOzDBwbQtc8BVumYmuu5xIoZZYMAVVOb2bKx6PUsjw,71
|
|
6
|
+
ysm-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
7
|
+
ysm-0.1.5.dist-info/entry_points.txt,sha256=pX5hfQtMqjzYcDJRxeHVZNymJn7Q6_PWw9mvZABIRbw,43
|
|
8
|
+
ysm-0.1.5.dist-info/top_level.txt,sha256=If5eidAs31PcrQ6LFtKE_uV535GkAyoozGk5hUkeZT4,4
|
|
9
|
+
ysm-0.1.5.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ysm
|