diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index f36ec5d..263b3e0 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -27,6 +27,7 @@ {"id":"nix-overlay-gkl","title":"Add codex-oauth-proxy package to overlay","description":"Package https://github.com/dvcrn/codex-oauth-proxy in packages/codex-oauth-proxy, verify nix build, document in README.","status":"closed","priority":2,"issue_type":"task","assignee":"generalist_specialist","created_at":"2026-11-11T18:51:43.391027417Z","created_by":"minder","updated_at":"2026-11-11T23:03:27.340922308Z","closed_at":"2026-11-11T23:03:27.340385233Z","close_reason":"codex-oauth-proxy 1.1.1 packaged, builds green with tests, documented in README","source_repo":"nix-overlay","compaction_level":0,"original_size":0} {"_type":"issue","id":"nix-overlay-hcf","title":"Update all overlay packages to latest upstream versions","description":"Bump every package in packages/ to its latest upstream release/commit using nix-update, then verify each builds. Working tree already carries uncommitted bumps for 15 packages (awg-tool, ds4, freebuff, freetoken, g3, graphify, hipengine, kubernetes-mcp-server, llama-cpp, marmel, omniroute, open-code-review, radar, skillsmcp, traycer); remaining packages (aionui, container-use, desloppify, haivemind, loop, mcp-gateway, nftables-analyzer, nftablesbuilder, relay-free-llm, shardr, stakpak) still need checking.","status":"closed","priority":2,"issue_type":"task","assignee":"Alexander Miroshnichenko","owner":"alex@millerson.name","created_at":"2026-10-06T12:54:12Z","created_by":"Alexander Miroshnichenko","updated_at":"2026-10-06T13:46:41Z","started_at":"2026-10-06T12:54:20Z","closed_at":"2026-10-06T13:46:41Z","close_reason":"All 26 packages checked: 16 committed in 6013b17aadbc; aionui/container-use/desloppify/loop/mcp-gateway/nftables-analyzer/nftablesbuilder/relay-free-llm/stakpak already current; 3 evaluation/version-string errors from nix-update repaired by hand. omniroute deferred to its own issue (stale npmDepsHash).","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"nix-overlay-ikz","title":"Add g3 package (dhanji/g3)","description":"Package g3 AI coding agent from https://github.com/dhanji/g3 as rustPlatform.buildRustPackage. Pin commit (no tags), ship g3 + g3-studio binaries, category AI Coding Agents.","status":"closed","priority":2,"issue_type":"feature","assignee":"Alexander Miroshnichenko","owner":"alex@millerson.name","created_at":"2026-09-23T10:59:57Z","created_by":"Alexander Miroshnichenko","updated_at":"2026-09-23T11:54:07Z","started_at":"2026-09-23T11:00:30Z","closed_at":"2026-09-23T11:54:07Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} +{"id":"nix-overlay-ka5","title":"Add Strata with ROCm 10 HIP support for gfx1151","description":"Package Niko1221/Strata using the existing TheRock ROCm 10 SDK, compile HIP kernels for gfx1151, document usage, and verify build and CLI.","status":"closed","priority":2,"issue_type":"feature","assignee":"minder","created_at":"2026-11-12T18:13:13.558104256Z","created_by":"minder","updated_at":"2026-11-12T18:28:20.466366213Z","closed_at":"2026-11-12T18:28:20.465072110Z","close_reason":"Completed: Strata 0.2.13 builds with TheRock ROCm 10.0 for gfx1151; installed command checks, formatting, flake evaluation, HTTP health/models/OpenAI/Anthropic mock APIs pass. Upstream HIP intrinsics numerical parity passed on host Radeon 8060S. Engine starts with package runtime libraries (unset inherited LD_LIBRARY_PATH pointing to GCC 15). Full model inference not exercised.","source_repo":"nix-overlay","compaction_level":0,"original_size":0} {"_type":"issue","id":"nix-overlay-m5y","title":"Add CodeAF package (Agent-Field/CodeAF)","description":"Add https://github.com/Agent-Field/CodeAF as a new package under packages/codeaf with default.nix + package.nix, staged for blueprint discovery, README table updated, nix build verified.","status":"closed","priority":2,"issue_type":"feature","assignee":"Alexander Miroshnichenko","owner":"alex@millerson.name","created_at":"2026-10-06T18:07:38Z","created_by":"Alexander Miroshnichenko","updated_at":"2026-10-06T18:46:34Z","started_at":"2026-10-06T18:08:19Z","closed_at":"2026-10-06T18:46:34Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"id":"nix-overlay-nn2","title":"marmel: drop session-boot-trust-store.patch once upstream stops panicking on a missing CA store","description":"packages/marmel/session-boot-trust-store.patch forwards SSL_CERT_FILE into\nthe env_clear()d child in tests/test_session_boot.rs. It is a workaround,\nnot the fix: src/llm/client.rs default_http_client() calls unwrap_or_default()\non Result, and reqwest's Client::default() is\nClient::new(), which repeats the same build and .expect()s it, so the fallback\nalways panics. Reproduced independently of Nix on a stock busybox image with no\n/etc/ssl.\n\nUpstream issue filed 2026-10-16, still open:\nhttps://github.com/Na1w/marmel/issues/13\n(\"marmel panics at startup instead of reporting a missing CA trust store\")\n\nBlocked on upstream. Once upstream propagates the error instead of discarding\nit, drop the patch, bump marmel to the fixing commit, and rebuild.\n","status":"closed","priority":3,"issue_type":"task","owner":"alex@millerson.name","created_at":"2026-10-16T11:32:29Z","created_by":"Alexander Miroshnichenko","updated_at":"2026-11-09T07:03:29.680285424Z","closed_at":"2026-11-09T07:03:29.673967963Z","close_reason":"Upstream fixed in 62cb756 (#16, 2026-10-18); session-boot-trust-store.patch was already dropped in adbed5f3c074. Current pin afcc1dc is 31 commits ahead of the fix and the package carries no such patch.","external_ref":"https://github.com/Na1w/marmel/issues/13","source_repo":".","compaction_level":0,"original_size":0} {"id":"nix-overlay-ocf","title":"agnix: ship agnix-lsp and agnix-mcp in the same package","description":"Extend packages/agnix to build -p agnix-cli -p agnix-lsp -p agnix-mcp, as upstream's release job does.","status":"closed","priority":3,"issue_type":"task","assignee":"minder","created_at":"2026-11-03T12:17:08.080999670Z","created_by":"minder","updated_at":"2026-11-03T12:33:21.279454904Z","closed_at":"2026-11-03T12:33:21.278951385Z","close_reason":"packages/agnix now builds -p agnix-cli -p agnix-lsp -p agnix-mcp; nix build .#agnix produces all three binaries; agnix-lsp answers LSP initialize with capabilities, agnix-mcp answers MCP initialize with serverInfo agnix 0.60.3","source_repo":"nix-overlay","compaction_level":0,"original_size":0} diff --git a/README.md b/README.md index db336e4..4d5700b 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ A custom Nix overlay and flake providing additional packages not found in upstre | `gufo` | Gufo with XDNA2 NPU support and the Unsloth UD 3.1 compatibility patch | AI Inference | | `xrt-amdxdna` | XRT with the amdxdna plugin, built against gufo's nixpkgs | AI Inference | | `therock-rocm` | TheRock 10.0 SDK for gfx1151 | AI Inference | +| `strata` | Strata inference engine, API server and CPU vision encoder with ROCm 10 HIP support for gfx1151 | AI Inference | | `pwilkin-llama-cpp` | pwilkin llama.cpp fork with ROCm for gfx1151 | AI Inference | | `strix-llama-cpp` | halo-box llama.cpp fork with Vulkan | AI Inference | | `loop` | Corporate messenger for your team | Communication | @@ -133,6 +134,21 @@ The consumer must configure NPU power and fabric clocks before using the NPU. TheRock and XRT use individual recipes from the pinned `nix-strix-halo` source tree. Its flake and Thunderbolt dependencies are not loaded. +Strata ships `strata` (the HIP engine), `strata-server` (the OpenAI/Anthropic HTTP +server, also the default for `nix run .#strata`) and `strata-vision` (CPU image +encoder). It uses the shared TheRock ROCm 10.0 SDK, compiles GPU kernels only for +`gfx1151`, and uses upstream's portable AVX2 CPU baseline. Model weights and vision +projectors are supplied separately. + +Run `nix run .#strata -- --help` for server options, or invoke the engine directly +with `nix shell .#strata -c strata --help`. For inference, pass +`strata-server --engine strata --config /path/to/strata.json`; the upstream +[server configuration](https://github.com/Niko1221/Strata/blob/v0.2.13/serve/server.py) +uses `exe`, `args`, `cwd`, `tokenizer` and `model_name`. Set `exe` to the packaged +`strata` executable and use writable model/log paths outside the Nix store. +The ROCm 7.14.1 hipBLASLt tuning table from the reference recipe is not enabled +with ROCm 10; the engine falls back to hipBLAS when no matching table is supplied. + ### nftablesbuilder Runtime Notes `nftablesbuilder` is a web interface for managing nftables. It consists of a diff --git a/_lib/llm-packages.nix b/_lib/llm-packages.nix index 768e61a..851c693 100644 --- a/_lib/llm-packages.nix +++ b/_lib/llm-packages.nix @@ -26,6 +26,9 @@ builtins.mapAttrs ) { inherit hipfire therock-rocm gufo; + strata = pkgs.callPackage ../packages/strata/package.nix { + therockRocm = therock-rocm; + }; hipfire-kernels = hipfire.kernels; xrt-amdxdna = gufo.xrt; kyojin = pkgs.callPackage ../packages/kyojin/package.nix { diff --git a/packages/strata/default.nix b/packages/strata/default.nix new file mode 100644 index 0000000..f32aaa6 --- /dev/null +++ b/packages/strata/default.nix @@ -0,0 +1,5 @@ +{ pkgs, inputs, ... }: +(import ../../_lib/llm-packages.nix { + inherit inputs; + system = pkgs.stdenv.hostPlatform.system; +}).strata diff --git a/packages/strata/package.nix b/packages/strata/package.nix new file mode 100644 index 0000000..c866fac --- /dev/null +++ b/packages/strata/package.nix @@ -0,0 +1,132 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + ninja, + makeWrapper, + python3, + glibc, + therockRocm, +}: +let + # The vision encoder needs the full llama.cpp tree at Strata's pinned ggml revision. + llama = fetchFromGitHub { + owner = "ggml-org"; + repo = "llama.cpp"; + rev = "3cf03257f219afbe7334045ff7c6a06ac68c627d"; + hash = "sha256-SRGoXa+4ACBCB3eaG9XFYhMN1i0FyPEy9Rrer+dFGYI="; + }; + python = python3.withPackages ( + ps: with ps; [ + jinja2 + pyyaml + numpy + regex + requests + psutil + pillow + jsonschema + referencing + truststore + certifi + tqdm + ] + ); + # The SDK compiler bypasses Nix's cc wrapper and needs explicit host paths. + hipHostFlags = lib.concatStringsSep " " [ + "--gcc-toolchain=${stdenv.cc.cc}" + "-idirafter ${lib.getDev glibc}/include" + "-B${glibc}/lib" + "-L${glibc}/lib" + "-L${stdenv.cc.cc.lib}/lib" + "-Wl,-rpath,${glibc}/lib:${stdenv.cc.cc.lib}/lib" + "-Wl,--dynamic-linker=${stdenv.cc.bintools.dynamicLinker}" + ]; +in +stdenv.mkDerivation (finalAttrs: { + pname = "strata"; + version = "0.2.13"; + + src = fetchFromGitHub { + owner = "Niko1221"; + repo = "Strata"; + tag = "v${finalAttrs.version}"; + hash = "sha256-ygLtDYyrwfRKez46xKnPkO7BtY0Q4uMwxlvh3JyUHbE="; + }; + + nativeBuildInputs = [ + cmake + ninja + makeWrapper + ]; + + cmakeFlags = [ + "-DSTRATA_ENABLE_HIP=ON" + "-DSTRATA_ENABLE_CUDA=OFF" + "-DSTRATA_PREFILL_MMQ=ON" + "-DSTRATA_BUILD_TESTS=OFF" + "-DSTRATA_PORTABLE=ON" + "-DCMAKE_HIP_ARCHITECTURES=gfx1151" + "-DCMAKE_HIP_COMPILER=${therockRocm}/lib/llvm/bin/clang++" + "-DCMAKE_HIP_COMPILER_ROCM_ROOT=${therockRocm}" + "-DCMAKE_PREFIX_PATH=${therockRocm};${therockRocm}/lib/rocm_sysdeps;${therockRocm}/lib/llvm" + "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${therockRocm}/lib:${therockRocm}/lib/rocm_sysdeps/lib" + ]; + + env = { + ROCM_PATH = "${therockRocm}"; + HIP_PATH = "${therockRocm}"; + HIP_PLATFORM = "amd"; + }; + + preConfigure = '' + cmakeFlagsArray+=("-DCMAKE_HIP_FLAGS=--rocm-path=${therockRocm} --rocm-device-lib-path=${therockRocm}/amdgcn/bitcode ${hipHostFlags}") + export PATH=${therockRocm}/bin:${therockRocm}/lib/llvm/bin:$PATH + export LD_LIBRARY_PATH=${therockRocm}/lib:${therockRocm}/lib/rocm_sysdeps/lib:${therockRocm}/lib/llvm/lib''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} + ''; + + ninjaFlags = [ "strata" ]; + + postBuild = '' + cmake -S ../tools/vision -B ../build-vision -G Ninja \ + -DCMAKE_BUILD_TYPE=Release -DLLAMA_DIR=${llama} \ + -DSTRATA_VISION_CUDA=OFF -DSTRATA_VISION_HIP=OFF -DSTRATA_PORTABLE=ON + cmake --build ../build-vision --target strata-vision -j $NIX_BUILD_CORES + ''; + + installPhase = '' + runHook preInstall + install -Dm755 strata $out/bin/strata + install -Dm755 ../build-vision/bin/strata-vision $out/bin/strata-vision + mkdir -p $out/share/strata + cp -r ../serve ../strata_control ../strata_cli ../tools ../data $out/share/strata/ + makeWrapper ${python}/bin/python $out/bin/strata-server \ + --add-flags "-m serve.server" \ + --prefix PYTHONPATH : $out/share/strata \ + --prefix PATH : $out/bin + runHook postInstall + ''; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + $out/bin/strata --help > /dev/null + $out/bin/strata-server --help > /dev/null + $out/bin/strata-vision --version > /dev/null + runHook postInstallCheck + ''; + + passthru = { + rocm = therockRocm; + category = "AI Inference"; + }; + + meta = { + description = "Strata inference engine and API server with ROCm 10 HIP kernels for gfx1151"; + homepage = "https://github.com/Niko1221/Strata"; + license = lib.licenses.mit; + platforms = [ "x86_64-linux" ]; + mainProgram = "strata-server"; + }; +})