Skip to content

Commit e32ed76

Browse files
committed
fix(byok): filter non-chat models, add verified/recommended badges, clean model list
1 parent 6176cd7 commit e32ed76

2 files changed

Lines changed: 46 additions & 7 deletions

File tree

backend/simpatico-ats.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7251,18 +7251,45 @@ async function handleBYOKValidate(request, env, ctx) {
72517251
});
72527252
}
72537253
const data = await res.json();
7254+
// Only include models that work with the OpenAI-compatible chat endpoint
7255+
// Exclude: gemma (local models), embedding, AQA, imagen, preview/experimental builds
7256+
const GEMINI_CHAT_VERIFIED = [
7257+
"gemini-2.5-flash", "gemini-2.5-pro",
7258+
"gemini-2.0-flash", "gemini-2.0-flash-lite",
7259+
"gemini-1.5-flash", "gemini-1.5-pro",
7260+
];
72547261
models = (data.models || [])
7255-
.filter(m => m.supportedGenerationMethods && m.supportedGenerationMethods.includes("generateContent"))
7262+
.filter(m => {
7263+
if (!m.supportedGenerationMethods || !m.supportedGenerationMethods.includes("generateContent")) return false;
7264+
const mid = m.name ? m.name.replace("models/", "") : "";
7265+
// Must start with "gemini-" (exclude gemma, embedding, imagen, etc.)
7266+
if (!mid.startsWith("gemini-")) return false;
7267+
// Exclude preview/experimental builds (contain "-preview-" or end with "-preview")
7268+
if (mid.includes("-preview")) return false;
7269+
// Exclude numbered snapshot builds (e.g. gemini-2.0-flash-001)
7270+
if (/\d{3}$/.test(mid)) return false;
7271+
// Exclude "-latest" aliases (redundant with the base model)
7272+
if (mid.endsWith("-latest")) return false;
7273+
return true;
7274+
})
72567275
.map(m => {
72577276
const mid = m.name ? m.name.replace("models/", "") : m.name;
7277+
const isVerified = GEMINI_CHAT_VERIFIED.includes(mid);
72587278
return {
7259-
id: mid, name: m.displayName || mid,
7279+
id: mid,
7280+
name: m.displayName || mid,
72607281
context_window: m.inputTokenLimit || null,
72617282
output_limit: m.outputTokenLimit || null,
72627283
recommended: (RECOMMENDED.gemini || []).includes(mid),
7284+
verified: isVerified,
72637285
};
72647286
})
7265-
.sort((a, b) => (b.recommended ? 1 : 0) - (a.recommended ? 1 : 0));
7287+
.sort((a, b) => {
7288+
// Sort: recommended first, then verified, then alphabetical
7289+
if (a.recommended !== b.recommended) return b.recommended ? 1 : -1;
7290+
if (a.verified !== b.verified) return b.verified ? 1 : -1;
7291+
return a.id.localeCompare(b.id);
7292+
});
72667293

72677294
} else if (provider === "openai") {
72687295
const oaiUrl = (base_url || "https://api.openai.com/v1") + "/models";

dashboard/hr.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,9 +1912,12 @@ <h4>Multi-Platform Job Syndication</h4>
19121912
_byokModels.forEach(m => {
19131913
const opt = document.createElement('option');
19141914
opt.value = m.id;
1915-
let label = m.recommended ? '⭐ ' : ' ';
1915+
let label = '';
1916+
if (m.recommended) label += '⭐ ';
1917+
else if (m.verified) label += '✅ ';
1918+
else label += ' ';
19161919
label += m.name || m.id;
1917-
if (m.context_window) label += ' (' + (m.context_window / 1000).toFixed(0) + 'k ctx)';
1920+
if (m.context_window) label += ' ' + (m.context_window / 1000).toFixed(0) + 'k ctx';
19181921
opt.textContent = label;
19191922
if (m.id === textInput.value) opt.selected = true;
19201923
select.appendChild(opt);
@@ -1937,12 +1940,21 @@ <h4>Multi-Platform Job Syndication</h4>
19371940
textInput.value = this.value;
19381941
const model = _byokModels.find(m => m.id === this.value);
19391942
const info = document.getElementById('byokModelInfo');
1940-
if (model && (model.context_window || model.output_limit)) {
1943+
if (model) {
19411944
info.style.display = 'block';
19421945
let html = '<strong>' + (model.name || model.id) + '</strong>';
19431946
if (model.context_window) html += ' — Context: ' + (model.context_window / 1000).toFixed(0) + 'k tokens';
19441947
if (model.output_limit) html += ' — Output: ' + (model.output_limit / 1000).toFixed(0) + 'k tokens';
1945-
if (model.recommended) html += ' — <span style="color:#15803d;">✓ Recommended for interviews</span>';
1948+
if (model.recommended) {
1949+
info.style.background = '#f0fdf4'; info.style.borderColor = '#bbf7d0'; info.style.color = '#166534';
1950+
html += '<br>⭐ <strong>Recommended</strong> — Best quality for AI interviews';
1951+
} else if (model.verified) {
1952+
info.style.background = '#eff6ff'; info.style.borderColor = '#bfdbfe'; info.style.color = '#1e40af';
1953+
html += '<br>✅ <strong>Verified</strong> — Works with interview chat API';
1954+
} else {
1955+
info.style.background = '#fffbeb'; info.style.borderColor = '#fde68a'; info.style.color = '#92400e';
1956+
html += '<br>⚠️ <strong>Unverified</strong> — May work but not tested for interviews';
1957+
}
19461958
info.innerHTML = html;
19471959
} else {
19481960
info.style.display = 'none';

0 commit comments

Comments
 (0)