Skip to content
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

Bump node-llama-cpp from 3.0.0-beta.44 to 3.5.0 #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 31, 2025

Bumps node-llama-cpp from 3.0.0-beta.44 to 3.5.0.

Release notes

Sourced from node-llama-cpp's releases.

v3.5.0

3.5.0 (2025-01-31)

Features

Bug Fixes

  • add missing Jinja features for DeepSeek (#425) (6e4bf3d)

Shipped with llama.cpp release b4600

To use the latest llama.cpp release available, run npx -n node-llama-cpp source download --release latest. (learn more)

v3.4.3

3.4.3 (2025-01-30)

Bug Fixes


Shipped with llama.cpp release b4599

To use the latest llama.cpp release available, run npx -n node-llama-cpp source download --release latest. (learn more)

v3.4.2

3.4.2 (2025-01-27)

Bug Fixes


Shipped with llama.cpp release b4567

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [node-llama-cpp](https://github.com/withcatai/node-llama-cpp) from 3.0.0-beta.44 to 3.5.0.
- [Release notes](https://github.com/withcatai/node-llama-cpp/releases)
- [Changelog](https://github.com/withcatai/node-llama-cpp/blob/master/.releaserc.ts)
- [Commits](withcatai/node-llama-cpp@v3.0.0-beta.44...v3.5.0)

---
updated-dependencies:
- dependency-name: node-llama-cpp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 31, 2025
@0xdevalias
Copy link
Contributor

@jehna The error in the tests seems to be related to this test:

test("Unminifies an example file successfully", async () => {
const fileIsMinified = async (filename: string) => {
const prompt = await testPrompt();
return await prompt(
`Your job is to read the following code and rate it's readabillity and variable names. Answer "EXCELLENT", "GOOD" or "UNREADABLE".`,
await readFile(filename, "utf-8"),
gbnf`${/("EXCELLENT" | "GOOD" | "UNREADABLE") [^.]+/}.`
);
};
const expectStartsWith = (expected: string[], actual: string) => {
assert(
expected.some((e) => actual.startsWith(e)),
`Expected "${expected}" but got ${actual}`
);
};
await expectStartsWith(
["UNREADABLE"],
await fileIsMinified(`fixtures/example.min.js`)
);
await humanify(
"local",
"fixtures/example.min.js",
"--verbose",
"--outputDir",
TEST_OUTPUT_DIR
);
await expectStartsWith(
["EXCELLENT", "GOOD"],
await fileIsMinified(`${TEST_OUTPUT_DIR}/deobfuscated.js`)
);
});

..snip..

# [2025-01-31 02:31:22]  Loading model with options {
#   modelPath: '/Users/runner/.humanifyjs/models/Phi-3.1-mini-4k-instruct-Q4_K_M.gguf',
#   gpuLayers: 0
# }
# Subtest: Unminifies an example file successfully
not ok 4 - Unminifies an example file successfully
  ---
  duration_ms: 85918.501084
  location: '/Users/runner/work/humanify/humanify/src/test/local.e2etest.ts:1:468'
  failureType: 'testCodeFailure'
  error: |-
    Expected "UNREADABLE" but got GOOD
    
    The given JavaScript function appears to be well-documented with appropriate variable names and a concise, clear code structure
  code: 'ERR_ASSERTION'
  name: 'AssertionError'
  expected: true
  actual: false
  operator: '=='
  stack: |-
    expectStartsWith (/Users/runner/work/humanify/humanify/src/test/local.e2etest.ts:24:5)
    TestContext.<anonymous> (/Users/runner/work/humanify/humanify/src/test/local.e2etest.ts:30:9)
    async Test.run (node:internal/test_runner/test:797:9)
    async Test.processPendingSubtests (node:internal/test_runner/test:527:7)
  ...
1..4
# tests 4
# suites 0
# pass 3
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 128948.906917
Error: Process completed with exit code 1.

Which is processing this file:

https://github.com/jehna/humanify/blob/533cc25a252aa1827e264b3338dba824d36de741/fixtures/example.min.js

By calling testPrompt:

const prompt = await testPrompt();
return await prompt(
`Your job is to read the following code and rate it's readabillity and variable names. Answer "EXCELLENT", "GOOD" or "UNREADABLE".`,
await readFile(filename, "utf-8"),
gbnf`${/("EXCELLENT" | "GOOD" | "UNREADABLE") [^.]+/}.`
);

Which wraps llama:

export const testPrompt = async () =>
await llama({
seed: 1,
model: process.env["MODEL"] ?? DEFAULT_MODEL
});

Which returns a function that expects params: systemPrompt, userPrompt, responseGrammar:

export async function llama(opts: {
seed?: number;
model: string;
disableGpu?: boolean;
}): Promise<Prompt> {
const disableGpu = opts.disableGpu ?? IS_CI;
const llama = await getLlama({ gpu: disableGpu ? false : "auto" });
const modelOpts: LlamaModelOptions = {
modelPath: getModelPath(opts?.model),
gpuLayers: disableGpu ? 0 : undefined
};
verbose.log("Loading model with options", modelOpts);
const model = await llama.loadModel(modelOpts);
const context = await model.createContext({ seed: opts?.seed });
return async (systemPrompt, userPrompt, responseGrammar) => {
const session = new LlamaChatSession({
contextSequence: context.getSequence(),
autoDisposeSequence: true,
systemPrompt,
chatWrapper: getModelWrapper(opts.model)
});
const response = await session.promptWithMeta(userPrompt, {
temperature: 0.8,
grammar: new LlamaGrammar(llama, {
grammar: `${responseGrammar}`
}),
stopOnAbortSignal: true
});
session.dispose();
return responseGrammar.parseResult(response.responseText);
};
}

The Gbnf helper is passed in as the responseGrammar:

gbnf`${/("EXCELLENT" | "GOOD" | "UNREADABLE") [^.]+/}.`

https://github.com/jehna/humanify/blob/533cc25a252aa1827e264b3338dba824d36de741/src/plugins/local-llm-rename/gbnf.ts


Looking at the node-llama-cpp CHANGELOG since 3.0.0-beta44 up till 3.5.0 for any breaking changes/similar related to the grammar:

@0xdevalias
Copy link
Contributor

0xdevalias commented Feb 7, 2025

Looking at the pull request history for bumping node-llama-cpp:

It seems there has been test failures as far back as:

With the last successful upgrade being:

Using a script from my dotfiles to check the old PR checks, and whether they still have logs available:

Old PR Checks
⇒ gh-check-pr-test-logs-exist --repo jehna/humanify --dependabot 'node-llama-cpp' --workflow 'Test'
🔍 Using auto-generated Dependabot search query: 'Bump node-llama-cpp author:app/dependabot'

🔍 Fetching PRs in jehna/humanify (Search: 'Bump node-llama-cpp author:app/dependabot')...

📋 Matching PRs:
  PR #25: Bump node-llama-cpp from 3.0.0-beta.42 to 3.0.0-beta.44
  PR #110: Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.0-beta.45
  PR #113: Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.0-beta.46
  PR #119: Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.0
  PR #123: Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.1
  PR #126: Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.3
  PR #148: Bump node-llama-cpp from 3.0.0-beta.44 to 3.1.1
  PR #194: Bump node-llama-cpp from 3.0.0-beta.44 to 3.2.0
  PR #235: Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.0
  PR #243: Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.1
  PR #259: Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.2
  PR #270: Bump node-llama-cpp from 3.0.0-beta.44 to 3.4.0
  PR #289: Bump node-llama-cpp from 3.0.0-beta.44 to 3.4.1
  PR #298: Bump node-llama-cpp from 3.0.0-beta.44 to 3.4.2
  PR #301: Bump node-llama-cpp from 3.0.0-beta.44 to 3.5.0

🚀 Fetching workflow checks for each PR (workflow: 'Test')...
  📝 PR #25 - Bump node-llama-cpp from 3.0.0-beta.42 to 3.0.0-beta.44
    SUCCESS Run: 10342020426, Job: 28624470785, Completed: 2024-08-11T18:55:39Z, https://github.com/jehna/humanify/actions/runs/10342020426/job/28624470785
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/10342020426/job/28624470785

  📝 PR #110 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.0-beta.45
    FAILURE Run: 10952237439, Job: 30410578743, Completed: 2024-09-20T02:44:38Z, https://github.com/jehna/humanify/actions/runs/10952237439/job/30410578743
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/10952237439/job/30410578743

  📝 PR #113 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.0-beta.46
    FAILURE Run: 10986565195, Job: 30500102243, Completed: 2024-09-23T02:21:16Z, https://github.com/jehna/humanify/actions/runs/10986565195/job/30500102243
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/10986565195/job/30500102243

  📝 PR #119 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.0
    FAILURE Run: 11006198263, Job: 30560096048, Completed: 2024-09-24T03:07:11Z, https://github.com/jehna/humanify/actions/runs/11006198263/job/30560096048
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/11006198263/job/30560096048

  📝 PR #123 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.1
    FAILURE Run: 11025072536, Job: 30619327495, Completed: 2024-09-25T02:18:48Z, https://github.com/jehna/humanify/actions/runs/11025072536/job/30619327495
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/11025072536/job/30619327495

  📝 PR #126 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.0.3
    FAILURE Run: 11044698764, Job: 30681065017, Completed: 2024-09-26T02:57:16Z, https://github.com/jehna/humanify/actions/runs/11044698764/job/30681065017
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/11044698764/job/30681065017

  📝 PR #148 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.1.1
    FAILURE Run: 11411055050, Job: 31754595756, Completed: 2024-10-18T21:13:18Z, https://github.com/jehna/humanify/actions/runs/11411055050/job/31754595756
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/11411055050/job/31754595756

  📝 PR #194 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.2.0
    FAILURE Run: 11605087286, Job: 32314887872, Completed: 2024-10-31T02:37:10Z, https://github.com/jehna/humanify/actions/runs/11605087286/job/32314887872
    ❌ Logs expired/unavailable - 🔗 https://github.com/jehna/humanify/actions/runs/11605087286/job/32314887872

  📝 PR #235 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.0
    FAILURE Run: 12131715473, Job: 33824331143, Completed: 2024-12-03T02:29:45Z, https://github.com/jehna/humanify/actions/runs/12131715473/job/33824331143
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/12131715473/job/33824331143
    📋 View failed logs: gh run view 12131715473 --repo jehna/humanify --log-failed

  📝 PR #243 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.1
    FAILURE Run: 12228072358, Job: 34105732535, Completed: 2024-12-09T03:00:43Z, https://github.com/jehna/humanify/actions/runs/12228072358/job/34105732535
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/12228072358/job/34105732535
    📋 View failed logs: gh run view 12228072358 --repo jehna/humanify --log-failed

  📝 PR #259 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.2
    FAILURE Run: 12554593031, Job: 35003489033, Completed: 2024-12-31T02:37:09Z, https://github.com/jehna/humanify/actions/runs/12554593031/job/35003489033
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/12554593031/job/35003489033
    📋 View failed logs: gh run view 12554593031 --repo jehna/humanify --log-failed

  📝 PR #270 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.4.0
    FAILURE Run: 12663197159, Job: 35289351219, Completed: 2025-01-08T02:58:25Z, https://github.com/jehna/humanify/actions/runs/12663197159/job/35289351219
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/12663197159/job/35289351219
    📋 View failed logs: gh run view 12663197159 --repo jehna/humanify --log-failed

  📝 PR #289 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.4.1
    FAILURE Run: 12941994481, Job: 36098955172, Completed: 2025-01-24T02:26:22Z, https://github.com/jehna/humanify/actions/runs/12941994481/job/36098955172
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/12941994481/job/36098955172
    📋 View failed logs: gh run view 12941994481 --repo jehna/humanify --log-failed

  📝 PR #298 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.4.2
    FAILURE Run: 13002502354, Job: 36263639435, Completed: 2025-01-28T02:39:24Z, https://github.com/jehna/humanify/actions/runs/13002502354/job/36263639435
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/13002502354/job/36263639435
    📋 View failed logs: gh run view 13002502354 --repo jehna/humanify --log-failed

  📝 PR #301 - Bump node-llama-cpp from 3.0.0-beta.44 to 3.5.0
    FAILURE Run: 13065242932, Job: 36456364632, Completed: 2025-01-31T02:32:51Z, https://github.com/jehna/humanify/actions/runs/13065242932/job/36456364632
    ✅ Logs exist: https://github.com/jehna/humanify/actions/runs/13065242932/job/36456364632
    📋 View failed logs: gh run view 13065242932 --repo jehna/humanify --log-failed

The oldest PR that still does have test error logs available seems to be:

  • Bump node-llama-cpp from 3.0.0-beta.44 to 3.3.0 #235
    • https://github.com/jehna/humanify/actions/runs/12131715473/job/33824331143
      • ..snip..
        
        # [2024-12-03 02:28:15]  Loading model with options {
        #   modelPath: '/Users/runner/.humanifyjs/models/Phi-3.1-mini-4k-instruct-Q4_K_M.gguf',
        #   gpuLayers: 0
        # }
        # Subtest: Unminifies an example file successfully
        not ok 4 - Unminifies an example file successfully
          ---
          duration_ms: 87609.07725
          location: '/Users/runner/work/humanify/humanify/src/test/local.e2etest.ts:1:468'
          failureType: 'testCodeFailure'
          error: |-
            Expected "UNREADABLE" but got GOOD
            
            The provided function `a` appears to be a sublist generator for slicing a string or an array in JavaScript
          code: 'ERR_ASSERTION'
          name: 'AssertionError'
          expected: true
          actual: false
          operator: '=='
          stack: |-
            expectStartsWith (/Users/runner/work/humanify/humanify/src/test/local.e2etest.ts:24:5)
            TestContext.<anonymous> (/Users/runner/work/humanify/humanify/src/test/local.e2etest.ts:30:9)
            async Test.run (node:internal/test_runner/test:797:9)
            async Test.processPendingSubtests (node:internal/test_runner/test:527:7)
          ...
        1..4
        # tests 4
        # suites 0
        # pass 3
        # fail 1
        # cancelled 0
        # skipped 0
        # todo 0
        # duration_ms 125798.5[195](https://github.com/jehna/humanify/actions/runs/12131715473/job/33824331143#step:9:196)41
        Error: Process completed with exit code 1.
        

Looking at the CHANGELOG entry for the version that started breaking:


The following links may be relevant for understanding if/what changes need to be made to the Gbnf grammar (or other ways to achieve similar):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant