Open History to see the last commit
1import { describe, expect, it } from 'vitest'
2import {
3 BEDROCK_API_COMPATIBILITY,
4 lookupBedrockCompatibility,
5 mantlePathForModel,
6} from '../src/api-compatibility'
7
8describe('Bedrock API compatibility config', () => {
9 it('puts Gemma 4 on /openai/v1 and Gemma 3 on /v1', () => {
10 expect(lookupBedrockCompatibility('google.gemma-4-31b').mantlePath).toBe(
11 '/openai/v1',
12 )
13 expect(lookupBedrockCompatibility('google.gemma-3-12b-it').mantlePath).toBe(
14 '/v1',
15 )
16 expect(mantlePathForModel('google.gemma-4-future')).toBe('/openai/v1')
17 expect(mantlePathForModel(undefined)).toBe('/v1')
18 })
19
20 it('seeds Gemma 4 ids that ListFoundationModels omits', () => {
21 const rule = BEDROCK_API_COMPATIBILITY.find(
22 (r) => r.match === 'google.gemma-4-',
23 )
24 expect(rule?.models?.map((m) => m.id)).toEqual([
25 'google.gemma-4-31b',
26 'google.gemma-4-26b-a4b',
27 'google.gemma-4-e2b',
28 ])
29 })
30})