@link-assistant/agent 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/provider/provider.ts +216 -0
package/package.json
CHANGED
package/src/provider/provider.ts
CHANGED
|
@@ -321,6 +321,48 @@ export namespace Provider {
|
|
|
321
321
|
options: {},
|
|
322
322
|
};
|
|
323
323
|
},
|
|
324
|
+
/**
|
|
325
|
+
* Kilo provider - access to 500+ AI models through Kilo Gateway
|
|
326
|
+
* Uses OpenAI-compatible API at https://api.kilo.ai/api/gateway
|
|
327
|
+
*
|
|
328
|
+
* Free models available without API key (using 'public' key):
|
|
329
|
+
* - GLM-5 (z-ai/glm-5) - Free limited time, flagship Z.AI model
|
|
330
|
+
* - GLM 4.7 (z-ai/glm-4.7:free) - Free, agent-centric model
|
|
331
|
+
* - Kimi K2.5 (moonshot/kimi-k2.5:free) - Free, agentic capabilities
|
|
332
|
+
* - MiniMax M2.1 (minimax/m2.1:free) - Free, general-purpose
|
|
333
|
+
* - Giga Potato (giga-potato:free) - Free evaluation model
|
|
334
|
+
*
|
|
335
|
+
* For paid models, set KILO_API_KEY environment variable
|
|
336
|
+
*
|
|
337
|
+
* @see https://kilo.ai/docs/gateway
|
|
338
|
+
* @see https://kilo.ai/docs/advanced-usage/free-and-budget-models
|
|
339
|
+
*/
|
|
340
|
+
kilo: async (input) => {
|
|
341
|
+
const hasKey = await (async () => {
|
|
342
|
+
if (input.env.some((item) => process.env[item])) return true;
|
|
343
|
+
if (await Auth.get(input.id)) return true;
|
|
344
|
+
return false;
|
|
345
|
+
})();
|
|
346
|
+
|
|
347
|
+
// For free models, we can use 'public' as the API key
|
|
348
|
+
// For paid models, user needs to set KILO_API_KEY
|
|
349
|
+
if (!hasKey) {
|
|
350
|
+
for (const [key, value] of Object.entries(input.models)) {
|
|
351
|
+
// Keep only free models (cost.input === 0) when no API key
|
|
352
|
+
if (value.cost.input === 0) continue;
|
|
353
|
+
delete input.models[key];
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return {
|
|
358
|
+
autoload: Object.keys(input.models).length > 0,
|
|
359
|
+
options: hasKey
|
|
360
|
+
? {}
|
|
361
|
+
: {
|
|
362
|
+
apiKey: 'public',
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
},
|
|
324
366
|
/**
|
|
325
367
|
* Qwen Coder OAuth provider for Qwen subscription users
|
|
326
368
|
* Uses OAuth credentials from agent auth login (Qwen Coder Subscription)
|
|
@@ -719,6 +761,170 @@ export namespace Provider {
|
|
|
719
761
|
models: {}, // Models are dynamically created based on the provider/model syntax
|
|
720
762
|
};
|
|
721
763
|
|
|
764
|
+
// Add Kilo provider for access to 500+ AI models through Kilo Gateway
|
|
765
|
+
// Free models available: GLM-5, GLM 4.7, Kimi K2.5, MiniMax M2.1, Giga Potato
|
|
766
|
+
// @see https://kilo.ai/docs/gateway
|
|
767
|
+
// @see https://github.com/link-assistant/agent/issues/159
|
|
768
|
+
database['kilo'] = {
|
|
769
|
+
id: 'kilo',
|
|
770
|
+
name: 'Kilo Gateway',
|
|
771
|
+
npm: '@ai-sdk/openai-compatible',
|
|
772
|
+
api: 'https://api.kilo.ai/api/gateway',
|
|
773
|
+
env: ['KILO_API_KEY'],
|
|
774
|
+
models: {
|
|
775
|
+
// GLM-5 - Flagship Z.AI model, free for limited time
|
|
776
|
+
'glm-5-free': {
|
|
777
|
+
id: 'z-ai/glm-5',
|
|
778
|
+
name: 'GLM-5 (Free)',
|
|
779
|
+
release_date: '2026-02-11',
|
|
780
|
+
attachment: false,
|
|
781
|
+
reasoning: true,
|
|
782
|
+
temperature: true,
|
|
783
|
+
tool_call: true,
|
|
784
|
+
cost: {
|
|
785
|
+
input: 0,
|
|
786
|
+
output: 0,
|
|
787
|
+
cache_read: 0,
|
|
788
|
+
cache_write: 0,
|
|
789
|
+
},
|
|
790
|
+
limit: {
|
|
791
|
+
context: 202752,
|
|
792
|
+
output: 131072,
|
|
793
|
+
},
|
|
794
|
+
modalities: {
|
|
795
|
+
input: ['text'],
|
|
796
|
+
output: ['text'],
|
|
797
|
+
},
|
|
798
|
+
options: {},
|
|
799
|
+
},
|
|
800
|
+
// GLM 4.7 - Agent-centric model, free
|
|
801
|
+
'glm-4.7-free': {
|
|
802
|
+
id: 'z-ai/glm-4.7:free',
|
|
803
|
+
name: 'GLM 4.7 (Free)',
|
|
804
|
+
release_date: '2026-01-15',
|
|
805
|
+
attachment: false,
|
|
806
|
+
reasoning: true,
|
|
807
|
+
temperature: true,
|
|
808
|
+
tool_call: true,
|
|
809
|
+
cost: {
|
|
810
|
+
input: 0,
|
|
811
|
+
output: 0,
|
|
812
|
+
cache_read: 0,
|
|
813
|
+
cache_write: 0,
|
|
814
|
+
},
|
|
815
|
+
limit: {
|
|
816
|
+
context: 131072,
|
|
817
|
+
output: 65536,
|
|
818
|
+
},
|
|
819
|
+
modalities: {
|
|
820
|
+
input: ['text'],
|
|
821
|
+
output: ['text'],
|
|
822
|
+
},
|
|
823
|
+
options: {},
|
|
824
|
+
},
|
|
825
|
+
// Kimi K2.5 - Agentic capabilities, free
|
|
826
|
+
'kimi-k2.5-free': {
|
|
827
|
+
id: 'moonshot/kimi-k2.5:free',
|
|
828
|
+
name: 'Kimi K2.5 (Free)',
|
|
829
|
+
release_date: '2025-12-01',
|
|
830
|
+
attachment: false,
|
|
831
|
+
reasoning: false,
|
|
832
|
+
temperature: true,
|
|
833
|
+
tool_call: true,
|
|
834
|
+
cost: {
|
|
835
|
+
input: 0,
|
|
836
|
+
output: 0,
|
|
837
|
+
cache_read: 0,
|
|
838
|
+
cache_write: 0,
|
|
839
|
+
},
|
|
840
|
+
limit: {
|
|
841
|
+
context: 131072,
|
|
842
|
+
output: 65536,
|
|
843
|
+
},
|
|
844
|
+
modalities: {
|
|
845
|
+
input: ['text'],
|
|
846
|
+
output: ['text'],
|
|
847
|
+
},
|
|
848
|
+
options: {},
|
|
849
|
+
},
|
|
850
|
+
// MiniMax M2.1 - General-purpose, free
|
|
851
|
+
'minimax-m2.1-free': {
|
|
852
|
+
id: 'minimax/m2.1:free',
|
|
853
|
+
name: 'MiniMax M2.1 (Free)',
|
|
854
|
+
release_date: '2025-11-01',
|
|
855
|
+
attachment: false,
|
|
856
|
+
reasoning: false,
|
|
857
|
+
temperature: true,
|
|
858
|
+
tool_call: true,
|
|
859
|
+
cost: {
|
|
860
|
+
input: 0,
|
|
861
|
+
output: 0,
|
|
862
|
+
cache_read: 0,
|
|
863
|
+
cache_write: 0,
|
|
864
|
+
},
|
|
865
|
+
limit: {
|
|
866
|
+
context: 131072,
|
|
867
|
+
output: 65536,
|
|
868
|
+
},
|
|
869
|
+
modalities: {
|
|
870
|
+
input: ['text'],
|
|
871
|
+
output: ['text'],
|
|
872
|
+
},
|
|
873
|
+
options: {},
|
|
874
|
+
},
|
|
875
|
+
// Giga Potato - Free evaluation model
|
|
876
|
+
'giga-potato-free': {
|
|
877
|
+
id: 'giga-potato:free',
|
|
878
|
+
name: 'Giga Potato (Free)',
|
|
879
|
+
release_date: '2026-01-01',
|
|
880
|
+
attachment: false,
|
|
881
|
+
reasoning: false,
|
|
882
|
+
temperature: true,
|
|
883
|
+
tool_call: true,
|
|
884
|
+
cost: {
|
|
885
|
+
input: 0,
|
|
886
|
+
output: 0,
|
|
887
|
+
cache_read: 0,
|
|
888
|
+
cache_write: 0,
|
|
889
|
+
},
|
|
890
|
+
limit: {
|
|
891
|
+
context: 65536,
|
|
892
|
+
output: 32768,
|
|
893
|
+
},
|
|
894
|
+
modalities: {
|
|
895
|
+
input: ['text'],
|
|
896
|
+
output: ['text'],
|
|
897
|
+
},
|
|
898
|
+
options: {},
|
|
899
|
+
},
|
|
900
|
+
// Trinity Large Preview - Preview model from Arcee AI
|
|
901
|
+
'trinity-large-preview': {
|
|
902
|
+
id: 'arcee/trinity-large-preview',
|
|
903
|
+
name: 'Trinity Large Preview (Free)',
|
|
904
|
+
release_date: '2026-01-01',
|
|
905
|
+
attachment: false,
|
|
906
|
+
reasoning: false,
|
|
907
|
+
temperature: true,
|
|
908
|
+
tool_call: true,
|
|
909
|
+
cost: {
|
|
910
|
+
input: 0,
|
|
911
|
+
output: 0,
|
|
912
|
+
cache_read: 0,
|
|
913
|
+
cache_write: 0,
|
|
914
|
+
},
|
|
915
|
+
limit: {
|
|
916
|
+
context: 65536,
|
|
917
|
+
output: 32768,
|
|
918
|
+
},
|
|
919
|
+
modalities: {
|
|
920
|
+
input: ['text'],
|
|
921
|
+
output: ['text'],
|
|
922
|
+
},
|
|
923
|
+
options: {},
|
|
924
|
+
},
|
|
925
|
+
},
|
|
926
|
+
};
|
|
927
|
+
|
|
722
928
|
for (const [providerID, provider] of configProviders) {
|
|
723
929
|
const existing = database[providerID];
|
|
724
930
|
const parsed: ModelsDev.Provider = {
|
|
@@ -1073,6 +1279,15 @@ export namespace Provider {
|
|
|
1073
1279
|
'big-pickle',
|
|
1074
1280
|
];
|
|
1075
1281
|
}
|
|
1282
|
+
if (providerID === 'kilo') {
|
|
1283
|
+
priority = [
|
|
1284
|
+
'glm-5-free',
|
|
1285
|
+
'glm-4.7-free',
|
|
1286
|
+
'kimi-k2.5-free',
|
|
1287
|
+
'minimax-m2.1-free',
|
|
1288
|
+
'giga-potato-free',
|
|
1289
|
+
];
|
|
1290
|
+
}
|
|
1076
1291
|
for (const item of priority) {
|
|
1077
1292
|
for (const model of Object.keys(provider.info.models)) {
|
|
1078
1293
|
if (model.includes(item)) return getModel(providerID, model);
|
|
@@ -1081,6 +1296,7 @@ export namespace Provider {
|
|
|
1081
1296
|
}
|
|
1082
1297
|
|
|
1083
1298
|
const priority = [
|
|
1299
|
+
'glm-5-free',
|
|
1084
1300
|
'kimi-k2.5-free',
|
|
1085
1301
|
'minimax-m2.1-free',
|
|
1086
1302
|
'gpt-5-nano',
|