* Get the effective profile for a model, with defaults for unknowns. * @param {string} modelName * @param {number} detectedContextWindow - From endpoint auto-detection (0 if unknown) * @returns {object}
(modelName, detectedContextWindow = 0)
| 115 | * @returns {object} |
| 116 | */ |
| 117 | function getProfile(modelName, detectedContextWindow = 0) { |
| 118 | const matched = matchProfile(modelName); |
| 119 | |
| 120 | const profile = { |
| 121 | context_length: detectedContextWindow || matched?.context_length || 32768, |
| 122 | max_output: matched?.max_output || 4096, |
| 123 | supports_tool_calling: matched?.supports_tool_calling ?? true, |
| 124 | tool_format: matched?.tool_format || 'native', |
| 125 | strengths: matched?.strengths || [], |
| 126 | weaknesses: matched?.weaknesses || [], |
| 127 | matched_key: matched?.matched_key || null, |
| 128 | }; |
| 129 | |
| 130 | return profile; |
| 131 | } |
| 132 | |
| 133 | module.exports = { KNOWN_PROFILES, matchProfile, getProfile }; |
no test coverage detected