Skip to content

Commit 75364d4

Browse files
committed
fix: model naming and api version
1 parent c00e9b5 commit 75364d4

3 files changed

Lines changed: 32 additions & 30 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ You can find the full API reference in the [API Reference Documentation](https:/
150150

151151
## Troubleshooting
152152

153-
1. GPT `o1-preview` and `o1-mini` it is still in beta. It does not support system roles, tools and the `temperature` and `topP` needs to be set to `1`. See OpenAI annocement [here](https://openai.com/index/introducing-openai-o1-preview/)
153+
1. GPT `o1-preview`, `o1` and `o1-mini` it is still in beta. It does not support system roles, tools and the `temperature` and `topP` needs to be set to `1`. See OpenAI annocement [here](https://openai.com/index/introducing-openai-o1-preview/)
154154
2. Cohere models only supports text output for now. Issue opened [here](https://github.com/orgs/community/discussions/142364).
155155

156156
## Contributing

src/github_llms.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export const metaLlama318bInstruct = modelRef({
224224
});
225225

226226
export const metaLlama3211bVisionInstruct = modelRef({
227-
name: "github/meta-llama-3.2-11b-vision-instruct",
227+
name: "github/Llama-3.2-11B-Vision-Instruct",
228228
info: {
229229
versions: ["Llama-3.2-11B-Vision-Instruct"],
230230
label: "Meta - Llama-3.2-11b-vision-instruct",
@@ -240,7 +240,7 @@ export const metaLlama3211bVisionInstruct = modelRef({
240240
});
241241

242242
export const metaLlama3290bVisionInstruct = modelRef({
243-
name: "github/meta-llama-3.2-90b-vision-instruct",
243+
name: "github/Llama-3.2-90B-Vision-Instruct",
244244
info: {
245245
versions: ["Llama-3.2-90B-Vision-Instruct"],
246246
label: "Meta - Llama-3.2-90b-vision-instruct",
@@ -257,7 +257,7 @@ export const metaLlama3290bVisionInstruct = modelRef({
257257

258258

259259
export const metaLlama3370bInstruct = modelRef({
260-
name: "github/meta-llama-3.3-70b-instruct",
260+
name: "github/Llama-3.3-70B-Instruct",
261261
info: {
262262
versions: ["Llama-3.3-70B-Instruct"],
263263
label: "Meta - Llama-3.3-70B-Instruct",
@@ -289,7 +289,7 @@ export const cohereCommandR = modelRef({
289289
});
290290

291291
export const cohereCommandR082024 = modelRef({
292-
name: "github/cohere-command-r",
292+
name: "github/Cohere-command-r-08-2024",
293293
info: {
294294
versions: ["Cohere-command-r-08-2024"],
295295
label: "Cohere - Command-r-08-2024",
@@ -321,7 +321,7 @@ export const cohereCommandRPlus = modelRef({
321321
});
322322

323323
export const cohereCommandRPlus082024 = modelRef({
324-
name: "github/cohere-command-r",
324+
name: "github/Cohere-command-r-plus-08-2024",
325325
info: {
326326
versions: ["Cohere-command-r-plus-08-2024"],
327327
label: "Cohere - Command-r-plus-08-2024",
@@ -337,7 +337,7 @@ export const cohereCommandRPlus082024 = modelRef({
337337
});
338338

339339
export const mistralSmall = modelRef({
340-
name: "github/mistral-small",
340+
name: "github/Mistral-small",
341341
info: {
342342
versions: ["Mistral-small"],
343343
label: "Mistral - Small",
@@ -353,7 +353,7 @@ export const mistralSmall = modelRef({
353353
});
354354

355355
export const mistralLarge = modelRef({
356-
name: "github/mistral-large",
356+
name: "github/Mistral-large",
357357
info: {
358358
versions: ["Mistral-large"],
359359
label: "Mistral - Large",
@@ -369,7 +369,7 @@ export const mistralLarge = modelRef({
369369
});
370370

371371
export const mistralLarge2407 = modelRef({
372-
name: "github/mistral-large-2407",
372+
name: "github/Mistral-large-2407",
373373
info: {
374374
versions: ["Mistral-large-2407"],
375375
label: "Mistral - Large-2407",
@@ -385,7 +385,7 @@ export const mistralLarge2407 = modelRef({
385385
});
386386

387387
export const mistralLarge2411 = modelRef({
388-
name: "github/mistral-large-2411",
388+
name: "github/Mistral-large-24111",
389389
info: {
390390
versions: ["Mistral-large-2411"],
391391
label: "Mistral - Large-2411",
@@ -401,7 +401,7 @@ export const mistralLarge2411 = modelRef({
401401
});
402402

403403
export const mistralCodestral2501 = modelRef({
404-
name: "github/codestral-2501",
404+
name: "github/Codestral-2501",
405405
info: {
406406
versions: ["Codestral-2501"],
407407
label: "Mistral - Codestral-2501",
@@ -417,7 +417,7 @@ export const mistralCodestral2501 = modelRef({
417417
});
418418

419419
export const mistralNemo = modelRef({
420-
name: "github/mistral-nemo",
420+
name: "github/Mistral-nemo",
421421
info: {
422422
versions: ["Mistral-nemo"],
423423
label: "Mistral - Nemo",
@@ -433,7 +433,7 @@ export const mistralNemo = modelRef({
433433
});
434434

435435
export const ministral3B = modelRef({
436-
name: "github/ministral-3b",
436+
name: "github/Ministral-3b",
437437
info: {
438438
versions: ["Ministral-3B"],
439439
label: "Ministral - 3B",
@@ -481,7 +481,7 @@ export const ai21Jamba15Large = modelRef({
481481
});
482482

483483
export const microsoftPhi3Mini4kInstruct = modelRef({
484-
name: "github/phi-3-mini-4k-instruct",
484+
name: "github/Phi-3-mini-4k-instruct",
485485
info: {
486486
versions: ["Phi-3-mini-4k-instruct"],
487487
label: "Microsoft - Phi-3-mini-4k-instruct",
@@ -497,7 +497,7 @@ export const microsoftPhi3Mini4kInstruct = modelRef({
497497
});
498498

499499
export const microsoftPhi3Mini128kInstruct = modelRef({
500-
name: "github/phi-3-mini-128k-instruct",
500+
name: "github/Phi-3-mini-128k-instruct",
501501
info: {
502502
versions: ["Phi-3-mini-128k-instruct"],
503503
label: "Microsoft - Phi-3-mini-128k-instruct",
@@ -513,7 +513,7 @@ export const microsoftPhi3Mini128kInstruct = modelRef({
513513
});
514514

515515
export const microsoftPhi3Small8kInstruct = modelRef({
516-
name: "github/phi-3-small-8k-instruct",
516+
name: "github/Phi-3-small-8k-instruct",
517517
info: {
518518
versions: ["Phi-3-small-8k-instruct"],
519519
label: "Microsoft - Phi-3-small-8k-instruct",
@@ -529,7 +529,7 @@ export const microsoftPhi3Small8kInstruct = modelRef({
529529
});
530530

531531
export const microsoftPhi3Small128kInstruct = modelRef({
532-
name: "github/phi-3-small-128k-instruct",
532+
name: "github/Phi-3-small-128k-instruct",
533533
info: {
534534
versions: ["Phi-3-small-128k-instruct"],
535535
label: "Microsoft - Phi-3-small-128k-instruct",
@@ -545,7 +545,7 @@ export const microsoftPhi3Small128kInstruct = modelRef({
545545
});
546546

547547
export const microsoftPhi3Medium4kInstruct = modelRef({
548-
name: "github/phi-3-medium-4k-instruct",
548+
name: "github/Phi-3-medium-4k-instruct",
549549
info: {
550550
versions: ["Phi-3-medium-4k-instruct"],
551551
label: "Microsoft - Phi-3-medium-4k-instruct",
@@ -561,7 +561,7 @@ export const microsoftPhi3Medium4kInstruct = modelRef({
561561
});
562562

563563
export const microsoftPhi3Medium128kInstruct = modelRef({
564-
name: "github/phi-3-medium-128k-instruct",
564+
name: "github/Phi-3-medium-128k-instruct",
565565
info: {
566566
versions: ["Phi-3-medium-128k-instruct"],
567567
label: "Microsoft - Phi-3-medium-128k-instruct",
@@ -577,7 +577,7 @@ export const microsoftPhi3Medium128kInstruct = modelRef({
577577
});
578578

579579
export const microsoftPhi35Mini128kInstruct = modelRef({
580-
name: "github/phi-3.5-mini-instruct",
580+
name: "github/Phi-3.5-mini-instruct",
581581
info: {
582582
versions: ["Phi-3.5-mini-instruct"],
583583
label: "Microsoft - Phi-3.5-mini-128k-instruct",
@@ -593,7 +593,7 @@ export const microsoftPhi35Mini128kInstruct = modelRef({
593593
});
594594

595595
export const microsoftPhi35MoE128kInstruct = modelRef({
596-
name: "github/phi-3.5-moe-instruct",
596+
name: "github/Phi-3.5-moe-instruct",
597597
info: {
598598
versions: ["Phi-3.5-moe-instruct"],
599599
label: "Microsoft - Phi-3.5-moe-128k-instruct",
@@ -609,7 +609,7 @@ export const microsoftPhi35MoE128kInstruct = modelRef({
609609
});
610610

611611
export const microsoftPhi35Vision128kInstruct = modelRef({
612-
name: "github/phi-3.5-vision-instruct",
612+
name: "github/Phi-3.5-vision-instruct",
613613
info: {
614614
versions: ["Phi-3.5-vision-instruct"],
615615
label: "Microsoft - Phi-3.5-vision-instruct",
@@ -625,7 +625,7 @@ export const microsoftPhi35Vision128kInstruct = modelRef({
625625
});
626626

627627
export const microsoftPhi4 = modelRef({
628-
name: "github/phi-4",
628+
name: "github/Phi-4",
629629
info: {
630630
versions: ["Phi-4"],
631631
label: "Microsoft - Phi-4",
@@ -657,7 +657,7 @@ export const jais30bChat = modelRef({
657657
});
658658

659659
export const deepseekR1 = modelRef({
660-
name: "github/deepseek-r1",
660+
name: "github/DeepSeek-R1",
661661
info: {
662662
versions: ["DeepSeek-R1"],
663663
label: "DeepSeek - R1",
@@ -687,10 +687,10 @@ export const SUPPORTED_GITHUB_MODELS: Record<string, any> = {
687687
"Llama-3.2-11B-Vision-Instruct": metaLlama3211bVisionInstruct,
688688
"Llama-3.2-90B-Vision-Instruct": metaLlama3290bVisionInstruct,
689689
"Llama-3.3-70B-Instruct": metaLlama3370bInstruct,
690-
"cohere-command-r": cohereCommandR,
691-
"cohere-command-r-plus": cohereCommandRPlus,
692-
"cohere-command-r-08-2024": cohereCommandR082024,
693-
"cohere-command-r-plus-08-2024": cohereCommandRPlus082024,
690+
"Cohere-command-r": cohereCommandR,
691+
"Cohere-command-r-plus": cohereCommandRPlus,
692+
"Cohere-command-r-08-2024": cohereCommandR082024,
693+
"Cohere-command-r-plus-08-2024": cohereCommandRPlus082024,
694694
"Mistral-small": mistralSmall,
695695
"Mistral-large": mistralLarge,
696696
"Mistral-large-2407": mistralLarge2407,
@@ -711,7 +711,7 @@ export const SUPPORTED_GITHUB_MODELS: Record<string, any> = {
711711
"Phi-3.5-vision-instruct": microsoftPhi35Vision128kInstruct,
712712
"Phi-4": microsoftPhi4,
713713
"jais-30b-chat": jais30bChat,
714-
"Deepseek-r1": deepseekR1,
714+
"DeepSeek-R1": deepseekR1,
715715
};
716716

717717
function toGithubRole(role: Role): string {

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ export {
107107
export interface PluginOptions {
108108
githubToken?: string;
109109
endpoint?: string;
110+
apiVersion?: string;
110111
}
111112

112113
export function github(options?: PluginOptions) {
113114
return genkitPlugin("github", async (ai: Genkit) => {
114115
const token = options?.githubToken || process.env.GITHUB_TOKEN;
115116
let endpoint = options?.endpoint || process.env.GITHUB_ENDPOINT;
117+
const apiVersion = options?.apiVersion || "2024-12-01-preview";
116118
if (!token) {
117119
throw new Error(
118120
"Please pass in the TOKEN key or set the GITHUB_TOKEN environment variable",
@@ -122,7 +124,7 @@ export function github(options?: PluginOptions) {
122124
endpoint = "https://models.inference.ai.azure.com";
123125
}
124126

125-
const client = ModelClient(endpoint, new AzureKeyCredential(token));
127+
const client = ModelClient(endpoint, new AzureKeyCredential(token), {apiVersion: apiVersion});
126128

127129
Object.keys(SUPPORTED_GITHUB_MODELS).forEach((name) => {
128130
githubModel(name, client, ai);

0 commit comments

Comments
 (0)