Skip to content

Commit cabcca1

Browse files
authored
Add Morph: WarpGrep V2 (#960)
2 parents 50dd7bc + 2ec27ed commit cabcca1

7 files changed

Lines changed: 68 additions & 9 deletions

File tree

src/lib/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { giga_potato_model, giga_potato_thinking_model } from '@/lib/providers/g
1212
import type { KiloFreeModel } from '@/lib/providers/kilo-free-model';
1313
import { minimax_m21_free_model, minimax_m25_free_model } from '@/lib/providers/minimax';
1414
import { kimi_k25_free_model } from '@/lib/providers/moonshotai';
15+
import { morph_warp_grep_free_model } from '@/lib/providers/morph';
1516
import { grok_code_fast_1_optimized_free_model } from '@/lib/providers/xai';
1617
import { zai_glm5_free_model } from '@/lib/providers/zai';
1718

@@ -60,6 +61,7 @@ export const kiloFreeModels = [
6061
kimi_k25_free_model,
6162
minimax_m25_free_model,
6263
minimax_m21_free_model,
64+
morph_warp_grep_free_model,
6365
grok_code_fast_1_optimized_free_model,
6466
zai_glm5_free_model,
6567
] as KiloFreeModel[];

src/lib/providers/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ export const PROVIDERS = {
8080
apiKey: getEnvVariable('MISTRAL_API_KEY'),
8181
hasGenerationEndpoint: false,
8282
},
83+
MORPH: {
84+
id: 'morph',
85+
apiUrl: 'https://api.morphllm.com/v1',
86+
apiKey: getEnvVariable('MORPH_API_KEY'),
87+
hasGenerationEndpoint: false,
88+
},
8389
VERCEL_AI_GATEWAY: {
8490
id: 'vercel',
8591
apiUrl: 'https://ai-gateway.vercel.sh/v1',

src/lib/providers/morph.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { KiloFreeModel } from '@/lib/providers/kilo-free-model';
2+
3+
export const morph_warp_grep_free_model: KiloFreeModel = {
4+
public_id: 'morph-warp-grep-v2',
5+
display_name: 'Morph: WarpGrep V2',
6+
description:
7+
'A code search subagent that finds relevant code in a separate context window — no embeddings, no indexing.',
8+
context_length: 256000,
9+
max_completion_tokens: 32000,
10+
is_enabled: true,
11+
flags: [],
12+
gateway: 'morph',
13+
internal_id: 'morph-warp-grep-v2',
14+
inference_provider: 'morph',
15+
};

src/lib/providers/openrouter/index.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isFreeModel, kiloFreeModels, preferredModels } from '@/lib/models';
1+
import { kiloFreeModels, preferredModels } from '@/lib/models';
22
import { PROVIDERS } from '@/lib/providers';
33
import type { OpenRouterModel } from '@/lib/organizations/organization-types';
44
import {
@@ -69,16 +69,10 @@ function enhancedModelList(models: OpenRouterModel[]) {
6969
const preferredIndex = preferredModels.indexOf(model.id);
7070
const ageDays = (Date.now() / 1_000 - model.created) / (24 * 3600);
7171
const isNew = preferredIndex >= 0 && ageDays >= 0 && ageDays < 7;
72-
const skipSuffix = model.name.endsWith(')') || /\bfree\b/i.test(model.name);
72+
const skipSuffix = model.name.endsWith(')');
7373
return {
7474
...model,
75-
name: skipSuffix
76-
? model.name
77-
: isFreeModel(model.id)
78-
? model.name + ' (free)'
79-
: isNew
80-
? model.name + ' (new)'
81-
: model.name,
75+
name: skipSuffix ? model.name : isNew ? model.name + ' (new)' : model.name,
8276
preferredIndex: preferredIndex >= 0 ? preferredIndex : undefined,
8377
settings: model.settings ?? getModelSettings(model.id),
8478
versioned_settings: model.versioned_settings ?? getVersionedModelSettings(model.id),

src/lib/providers/openrouter/inference-provider-id.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const OpenRouterInferenceProviderIdSchema = z.enum([
1111
'google-vertex',
1212
'inception',
1313
'moonshotai',
14+
'morph',
1415
'xai',
1516
'minimax',
1617
'mistral',

src/lib/providers/provider-id.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export type ProviderId =
44
| 'corethink'
55
| 'martian'
66
| 'mistral'
7+
| 'morph'
78
| 'vercel'
89
| 'custom'
910
| 'dev-tools';

src/tests/openrouter-models-sorting.approved.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,46 @@
594594
}
595595
}
596596
},
597+
{
598+
"id": "morph-warp-grep-v2",
599+
"canonical_slug": "morph-warp-grep-v2",
600+
"hugging_face_id": "",
601+
"name": "Morph: WarpGrep V2",
602+
"created": 1756238927,
603+
"description": "A code search subagent that finds relevant code in a separate context window — no embeddings, no indexing.",
604+
"context_length": 256000,
605+
"architecture": {
606+
"modality": "text->text",
607+
"input_modalities": [
608+
"text"
609+
],
610+
"output_modalities": [
611+
"text"
612+
],
613+
"tokenizer": "Other",
614+
"instruct_type": null
615+
},
616+
"pricing": {
617+
"prompt": "0.0000000",
618+
"completion": "0.0000000",
619+
"request": "0",
620+
"image": "0",
621+
"web_search": "0",
622+
"internal_reasoning": "0"
623+
},
624+
"top_provider": {
625+
"context_length": 256000,
626+
"max_completion_tokens": 32000,
627+
"is_moderated": false
628+
},
629+
"per_request_limits": null,
630+
"supported_parameters": [
631+
"max_tokens",
632+
"temperature",
633+
"tools"
634+
],
635+
"default_parameters": {}
636+
},
597637
{
598638
"id": "kilo-auto/small",
599639
"name": "Kilo Auto Small",

0 commit comments

Comments
 (0)