Download scripts/ping_models.py from debudash/slm-training: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/debudash/slm-training/resolve/main/scripts/ping_models.py
- Command line
-
hf download hf://debudash/slm-training/scripts/ping_models.py
-
curl -L -o ping_models.py https://huggingface.co/debudash/slm-training/resolve/main/scripts/ping_models.py
1.17 kB
| """Check both ceiling models answer with the keys in .env. Costs a fraction of a cent.""" | |
| import anthropic | |
| from dotenv import load_dotenv | |
| from openai import OpenAI | |
| import os | |
| load_dotenv() | |
| QUESTION = "Reply with exactly one line: 2026-01-10T12:00:00 in Etc/UTC converted to Asia/Tokyo, as YYYY-MM-DDTHH:MM:SS+HH:MM." | |
| sonnet = anthropic.Anthropic().messages.create( | |
| model="claude-sonnet-5-5", | |
| max_tokens=1024, | |
| thinking={"type": "between_tools"}, # Sonnet 5.5's thinking-off mode | |
| messages=[{"role": "user", "content": QUESTION}], | |
| ) | |
| print("sonnet :", sonnet.stop_reason, "|", next(b.text for b in sonnet.content if b.type == "text").strip()) | |
| mistral = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"]).chat.completions.create( | |
| model="mistralai/mistral-large-4-0", | |
| temperature=0, | |
| seed=7, | |
| max_tokens=256, | |
| extra_body={"reasoning": {"effort": "none"}}, # Mistral Large 4 reasons by default; off for a direct reply | |
| messages=[{"role": "user", "content": QUESTION}], | |
| ) | |
| print("mistral:", mistral.choices[0].finish_reason, "|", mistral.choices[0].message.content.strip()) | |