-
Notifications
You must be signed in to change notification settings - Fork 759
Pi: emit "input": ["text", "image"] for vision-capable models #2128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
7b0e996
c4a9eb0
671b44f
bf73c01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -466,6 +466,7 @@ const snippetMlxLm = (model: ModelData): LocalAppSnippet[] => { | |
| const snippetPi = (model: ModelData, filepath?: string): LocalAppSnippet[] => { | ||
| const modelName = model.id.split("/").pop() ?? model.id; | ||
| const isMLX = isMlxModel(model); | ||
| const isVision = model.pipeline_tag === "image-text-to-text"; | ||
|
|
||
| // Step 1: Server — differs by backend | ||
| const serverStep: LocalAppSnippet = isMLX | ||
|
|
@@ -481,14 +482,18 @@ const snippetPi = (model: ModelData, filepath?: string): LocalAppSnippet[] => { | |
| }; | ||
|
|
||
| // Step 2: Pi config — port and provider name differ | ||
| const modelEntry: Record<string, unknown> = { id: isMLX ? model.id : modelName }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing
|
||
| if (isVision) { | ||
| modelEntry.input = ["text", "image"]; | ||
| } | ||
| const modelsJson = JSON.stringify( | ||
| { | ||
| providers: { | ||
| [isMLX ? "mlx-lm" : "llama-cpp"]: { | ||
| baseUrl: "http://localhost:8080/v1", | ||
| api: "openai-completions", | ||
| apiKey: "none", | ||
| models: [{ id: isMLX ? model.id : modelName }], | ||
| models: [modelEntry], | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test expects
--jinjaflag that implementation never producesHigh Severity
The new vision test asserts that
snippet[0].contentcontains--jinjain thellama-servercommand, but thesnippetPiimplementation at line 481 builds the content as`llama-server -hf ${model.id}${getQuantTag(filepath)}`with no--jinjaflag appended — and no other code path adds it. The--jinjastring appears nowhere inlocal-apps.ts. This test will fail at runtime. Given the PR discussion confirming jinja is now default in llama.cpp, the test expectation is likely stale and the assertion needs to drop--jinja.Additional Locations (1)
packages/tasks/src/local-apps.ts#L480-L481Reviewed by Cursor Bugbot for commit bf73c01. Configure here.