Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/tasks/src/local-apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,19 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\

expect(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
});

it("nexa-sdk", async () => {
const { snippet: snippetFunc } = LOCAL_APPS["nexa-sdk"];
const model: ModelData = {
id: "NexaAI/OmniNeural-4B",
tags: [],
inference: "",
};
const snippet = snippetFunc(model);

expect(snippet.length).toBe(8);
expect(snippet[0].content).toBe(
`nexa infer NexaAI/OmniNeural-4B --prompt "NexaAI embraces HuggingFace and open source."`
);
});
});
29 changes: 29 additions & 0 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ const snippetLemonade = (model: ModelData, filepath?: string): LocalAppSnippet[]
];
};

const snippetNexaSdk = (model: ModelData): string => {
return `nexa infer ${model.id}`;
};

/**
* Add your new local app here.
*
Expand Down Expand Up @@ -545,6 +549,31 @@ export const LOCAL_APPS = {
displayOnModelPage: (model) => isLlamaCppGgufModel(model) || isAmdRyzenModel(model),
snippet: snippetLemonade,
},
"nexa-sdk": {
prettyLabel: "Nexa SDK",
docsUrl: "https://docs.nexa.ai/",
mainTask: "text-generation",
displayOnModelPage: (model) => {
const supportedPipelineTags = new Set([
"text-generation",
"text-to-speech",
"automatic-speech-recognition",
"image-text-to-text",
"audio-text-to-text",
"text-ranking",
"text-to-image",
"image-classification",
"object-detection",
]);
return (
model.id.startsWith("NexaAI/") ||
((isLlamaCppGgufModel(model) || isMlxModel(model) || isAmdRyzenModel(model)) &&
model.pipeline_tag !== undefined &&
supportedPipelineTags.has(model.pipeline_tag))
);
},
snippet: snippetNexaSdk,
},
} satisfies Record<string, LocalApp>;

export type LocalAppKey = keyof typeof LOCAL_APPS;