diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/test_devstral.py b/test_devstral.py index 10c0afb..b807e23 100644 --- a/test_devstral.py +++ b/test_devstral.py @@ -14,8 +14,18 @@ import time import json import httpx from datetime import datetime +from pathlib import Path + +# Load .env if present (don't hardcode keys) +_env_file = Path(__file__).parent / ".env" +if _env_file.exists(): + for line in _env_file.read_text().splitlines(): + line = line.strip() + if not line or line.startswith("#") or "=" not in line: + continue + k, v = line.split("=", 1) + os.environ.setdefault(k.strip(), v.strip()) -# Point at the middleware, NOT SGLang directly API_BASE = os.environ.get("DEVSTRAL_API_BASE", "http://127.0.0.1:8002/v1") API_KEY = os.environ.get("DEVSTRAL_API_KEY", "whatever") MODEL = os.environ.get("DEVSTRAL_MODEL", "mistralai/Devstral-2-123B-Instruct-2512") @@ -325,7 +335,7 @@ def test_param_sweep(): ("temperature", 0.7), ("seed", 42), ("stop", ["\n"]), - ("logprobs", True), + ("logprobs+top_logprobs", {"logprobs": True, "top_logprobs": 5}), ("top_logprobs", 5), ]