-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-models.min.js
More file actions
5 lines (5 loc) · 2.59 KB
/
Copy pathtest-models.min.js
File metadata and controls
5 lines (5 loc) · 2.59 KB
1
2
3
4
5
const API_KEY=process.env.FEATHERLESS_API_KEY;if(!API_KEY){console.error('Set FEATHERLESS_API_KEY');process.exit(1)}
const OpenAI=require('openai');const client=new OpenAI({apiKey:API_KEY,baseURL:'https://api.featherless.ai/v1'})
const MODELS=["DreamFast/gemma-3-12b-it-heretic-v2","Sabomako/gemma-3-12b-it-heretic","Lightricks/gemma-3-12b-it-qat-q4_0-unquantized","Trendyol/Trendyol-LLM-Asure-12B","nvidia/Nemotron-Terminal-14B","farbodtavakkoli/OTel-LLM-14B-IT","DavidAU/gemma-3-12b-it-vl-GLM-4.7-Flash-Heretic-Uncensored-Thinking","DreamFast/gemma-3-12b-it-heretic","TheDrummer/Rocinante-X-12B-v1","DavidAU/Mistral-Nemo-2407-12B-Thinking-Claude-Gemini-GPT5.2-Uncensored-HERETIC","McGill-NLP/AfriqueQwen-14B","TeichAI/Qwen3-14B-Claude-4.5-Opus-High-Reasoning-Distill","p-e-w/gemma-3-12b-it-heretic-v2"]
const TOOLS=[{type:'function',function:{name:'bash',description:'Execute bash',parameters:{type:'object',properties:{command:{type:'string'}},required:['command']}}}]
async function testModel(m){try{await client.chat.completions.create({model:m,messages:[{role:'user',content:'test'}],max_tokens:10})}catch(e){if(e.status===404||e.status===401||e.message?.includes('gated')||e.message?.includes('not available'))return{model:m,status:'unavailable',reason:e.message?.slice(0,80)||'error'};if(e.message?.includes('completion service'))return{model:m,status:'error',reason:'service error'};return{model:m,status:'error',reason:e.message?.slice(0,80)||'error'}}}try{const r=await client.chat.completions.create({model:m,messages:[{role:'user',content:'Run: echo hello'}],tools:TOOLS,max_tokens:150,temperature:0.7});const msg=r.choices[0].message,tc=msg.tool_calls;if(tc&&tc.length>0)return{model:m,status:'native',tool_count:tc.length};const c=msg.content||'';if(c.includes('<function>')||c.includes('')||c.includes('call:'))return{model:m,status:'xml'};return{model:m,status:'none',sample:c.slice(0,60)}}catch(e){return{model:m,status:'error',reason:e.message?.slice(0,80)||'error'}}}(async()=>{console.log('Model Status Details');console.log('-----------------------------------------------');for(const m of MODELS){const r=await testModel(m);const n=m.split('/').pop().substring(0,32).padEnd(32);if(r.status==='native')console.log(n+' native tool_calls:'+r.tool_count);else if(r.status==='xml')console.log(n+' xml needs parser');else if(r.status==='custom')console.log(n+' custom '+r.sample);else if(r.status==='none')console.log(n+' none '+r.sample);else if(r.status==='unavailable')console.log(n+' unavailable '+r.reason);else console.log(n+' error '+(r.reason||r.status))}})();