File size: 1,722 Bytes
dda6bed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
config/settings.py β€” all constants in one place.
Change values here; nothing else needs editing.
"""

# ── API ───────────────────────────────────────────────────────────────────────
API_BASE_URL   = "https://api.modelbest.cn/v1"

# Free public key provided by OpenBMB β€” rate-limited, no signup.
# Set env var MINICPM_API_KEY to override at runtime without touching code.
PUBLIC_API_KEY = "sk-pQ8L2zF3XmR5kY9wV4jB7hN1tC6vM0xG3aD5sH2bJ9lK4cZ8"

# ── Models ────────────────────────────────────────────────────────────────────
# Both are 1.3 B parameters β€” well under the 32 B cap.
MODELS: dict[str, str] = {
    "⚑ Instruct  (fast, direct)":  "MiniCPM-V-4.6-Instruct",
    "🧠 Thinking  (reasons first)": "MiniCPM-V-4.6-Thinking",
}

MODEL_PARAMS: dict[str, str] = {
    "MiniCPM-V-4.6-Instruct": "1.3 B",
    "MiniCPM-V-4.6-Thinking": "1.3 B",
}

# ── Generation defaults ───────────────────────────────────────────────────────
DEFAULT_PROMPT      = "Describe this image in detail."
DEFAULT_MAX_TOKENS  = 512
DEFAULT_TEMPERATURE = 0.7

# ── Image encoding ────────────────────────────────────────────────────────────
IMAGE_QUALITY = 90          # JPEG quality sent to the API (0-100)