← Back to Pull requests

ollama{,-cpu,-cuda,-rocm,-vulkan}: use strictDeps and structuredAttrs, migrate variants to by-name #580724

Open
unknown opened this pull request with 473 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 29, 2026 23:43 UTC
Author

The below PR summary is generated by Github Copilot

This pull request refactors the packaging of the ollama tool and its hardware-accelerated variants. The main change is to split each acceleration backend (cpu, cuda, rocm, vulkan) into its own package file, rather than using a single package with different parameters. This makes the codebase clearer and easier to maintain.

Refactoring and package separation:

Created separate package files for each ollama backend: ollama-cpu, ollama-cuda, ollama-rocm, and ollama-vulkan, each setting the appropriate acceleration parameter and removing the ollama attribute from the arguments (pkgs/by-name/ol/ollama-cpu/package.nix, pkgs/by-name/ol/ollama-cuda/package.nix, pkgs/by-name/ol/ollama-rocm/package.nix, pkgs/by-name/ol/ollama-vulkan/package.nix). [[1]](diffhunk://#diff-493df228f019e0041fbbe2d6c9c7522a67897df6434c110e132e7f8909599d24R1-R11) [[2]](diffhunk://#diff-1c52bd6b62c59995012bfd60f9e1ba26c39a2587a856c16e944696b60bbeb89dR1-R11) [[3]](diffhunk://#diff-5e6b4f575e603c43529f1062e47650a5737b93d6af2489fa1d0a9d0f975ce624R1-R11) [[4]](diffhunk://#diff-42ed0457e4d55ca1f60de7b912ba85ce9f06f632e05d2452aac68e68e80433fcR1-R11)

Removed the old in-place variant definitions from all-packages.nix, which previously called the main ollama package with different parameters (pkgs/top-level/all-packages.nix).

Build improvements:

  • Enabled strictDeps and __structuredAttrs in the main ollama package definition to improve build reliability and attribute handling (pkgs/by-name/ol/ollama/package.nix).

  • <!--
    ^ Please summarise the changes you have done and explain why they are necessary here ^

    For package updates please link to a changelog or describe changes, this helps your fellow maintainers discover breaking updates.
    For new packages please briefly describe the package or provide a link to its homepage.
    -->

    Things done

    <!--
    Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.
    However, please do not remove the template, even when nothing is checked!
    -->

  • Fits [CONTRIBUTING.md], [pkgs/README.md], [maintainers/README.md] and other READMEs.

  • Follows the [automation/AI policy].

  • Built on platform:

  • - [x] x86_64-linux
    - [ ] aarch64-linux
    - [ ] aarch64-darwin
  • Tested, as applicable:

  • - [ ] Basic functionality of all binary files, usually in ./result/bin/.
    - [ ] Ran nixpkgs-review on this PR. See [nixpkgs-review usage].
    - [ ] [Package tests] at passthru.tests.
    - [ ] [NixOS tests] in [nixos/tests].
    - [ ] Tests in [lib/tests] or [pkgs/test] for functions and "core" functionality.
  • Nixpkgs Release Notes

  • - [ ] Package update: when the change is major or breaking.
  • NixOS Release Notes

  • - [ ] Module addition: when adding a new NixOS module.
    - [ ] Module update: when the change is significant.

    [Package tests]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-tests
    [NixOS tests]: https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests
    [nixpkgs-review usage]: https://github.com/Mic92/nixpkgs-review#usage

    [CONTRIBUTING.md]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md
    [automation/AI policy]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy
    [lib/tests]: https://github.com/NixOS/nixpkgs/blob/master/lib/tests
    [maintainers/README.md]: https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md
    [nixos/tests]: https://github.com/NixOS/nixpkgs/blob/master/nixos/tests
    [pkgs/README.md]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md
    [pkgs/test]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/test

    Diff: 473 lines (+354 / -119) across 5 files Reviewer: guylamar2006 Review duration: 47196m
    All Vouch review confidence checks passed
    Residual risk 0.48 = Change Risk (0.81) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.81 · 473 lines diff across 5 files
    0.81
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.369
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.081
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #580724"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 40.9% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 80.9% (HIGH) · Higher = larger blast radius
    80.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.9% · Lower = rushed or shallow review
    40.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 47.8% · Moderate risk
    47.8%
    Repository