Skip to content

Add pion recipe - #391

Open
pavelhorak wants to merge 3 commits into
modular:mainfrom
pavelhorak:add-pion
Open

pavelhorak wants to merge 3 commits into
modular:mainfrom
pavelhorak:add-pion

Conversation

@pavelhorak

@pavelhorak pavelhorak commented Oct 6, 2026 •

Copy link
Copy Markdown

Adds Pion 0.9.7, a key-value and vector database written in Mojo that speaks the Redis protocol (RESP2/RESP3). Its main job is to be a local model's memory: it keeps a prompt's K/V cache across processes and restarts. The package installs the pion-server executable. Caroline suggested this channel on Pion's forum showcase thread.

  • Source: the archive of the v0.9.7 tag.
  • Build: build.sh runs the same commands as Pion's release workflow, with mojo-compiler ==1.1.0. It pins the target CPU per platform (apple-m1, x86-64-v2, neoverse-n1), so the binary runs on any machine of its platform. It stamps the version from the source's VERSION and the tag's commit (the recipe's commit), so the binary reports what the release binaries report. On macOS it also compiles the Metal shader for --metal-attention when full Xcode is present.
  • Tests: test_server.sh checks pion-server --version, then starts the server on a random port. It runs the two standard-library checks Pion's release workflow runs before packaging: tests/test_raw.py (wire basics) and tests/test_vector_recall_smoke.py (a 1536-dim recall check).

Licensing. The engine is Apache-2.0. The tuned 1536-dim vector kernels are a free, closed static library kept in the repository (vendor/pion-vector, under the Pion Vector Binary Licence). This build links it, as Pion's release binaries do. All three licence files are packaged, and license: reads Apache-2.0 AND LicenseRef-Pion-Vector-Binary-Licence-1.0. If the channel should carry only fully open builds, I can switch the recipe to the repository's build-open variant, which builds everything from source with the open reference kernels.

Checklist

  • My recipe.yaml specifies the compatible version: mojo-compiler ==1.1.0 (host and run). It doesn't depend on MAX.
  • License file is packaged: LICENSE, NOTICE and vendor/pion-vector/LICENSE.
  • Set the build number to 0 (new package).
  • Bumped the build number (not applicable, new package).

Verification
Built and tested on osx-arm64 with rattler-build 0.30.0. It used the channels and variant config that build-all uses:

rattler-build build --channel conda-forge --channel https://conda.modular.com/max \
  --channel https://prefix.dev/modular-community \
  --variant-config variants/variants.yaml --recipe recipes/pion/recipe.yaml

The result is pion-0.9.7-h60d57d3_0.conda (1.6 MB) with ✔ all tests passed!:

  • the binary reports pion-server 0.9.7+720a55c and is linked against the tuned kernels;
  • test_raw.py passed 115/115;
  • the vector smoke test passed with recall@10 0.978.

The recipe also validates against the recipe-format JSON schema.

This Mac has no full Xcode, so the local package was built without the Metal shader. On a runner with full Xcode, the shader is compiled into share/pion. The two Linux platforms were not built locally. On them, build.sh runs the commands Pion's release workflow runs on ubuntu-24.04 and ubuntu-24.04-arm, plus the CPU pin.

Updated to 0.9.6 (2026-10-07), which fixes a heap overflow reachable from the network in every earlier Pion release. Only version and sha256 changed; the package was rebuilt and retested as above.

Updated to 0.9.7 (2026-10-07). Besides version and sha256, build.sh now stamps the version at build time. v0.9.7's committed version.mojo still said 0.9.6, and the version test caught it (fixed in Pion for later tags). The package was rebuilt and retested as above, and the recipe still validates against the schema.

Pion 0.9.5 is a Redis-compatible key-value and vector database written in
Mojo, with a persistent prompt cache for local models. The recipe builds
pion-server from the v0.9.5 tag with mojo-compiler 1.1.0. Its tests run
the release workflow's wire test and vector-recall smoke test against the
installed package.
0.9.6 fixes a heap overflow reachable from the network in every earlier release. The build files are unchanged. Rebuilt and tested on osx-arm64 with rattler-build 0.30.0: test_raw.py 115/115, vector smoke recall@10 0.978.
v0.9.7's committed src/common/version.mojo still says 0.9.6, so the
package reported 0.9.6 and its version test failed. build.sh now stamps
the file from VERSION, as Pion's own build does, and names the tag's commit
so the binary reports 0.9.7+720a55c like the release binaries.
@alisterburt

Copy link
Copy Markdown
Collaborator

@pavelhorak thanks for this - I'm actually not sure what our stance is on distributing code for which we can't see the source... let me check and get back to you

@carolinefrasca

Copy link
Copy Markdown
Member

Hi @pavelhorak, thanks for your interest in distributing this through the Modular community channel!

I realize my earlier forum message was misleading, so I want to clarify: unfortunately, we can’t distribute closed source binaries through this channel.

Distributing closed source components would mean we’d need to verify the safety of that code, which is difficult to do with complete certainty for a closed source binary. My apologies for the miscommunication here.

You’re welcome to distribute the open source or source-available portions of your project through this channel.

Sorry again for the confusion, and thanks for sharing your project!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants