Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions aetherpak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ pages_url: https://lemonade-sdk.github.io/flatpak
branding:
index_template: .github/workflows/templates/lemonade.html

defaults:
remotes:
amd-npu: https://abn.github.io/flatpaks-amd-npu/amd-npu.flatpakrepo
lemonade: https://lemonade-sdk.github.io/flatpak/lemonade.flatpakrepo

apps:
- id: ai.lemonade_server.Lemonade
branch: stable
arches:
- x86_64
- aarch64
manifest: ai.lemonade_server.Lemonade/ai.lemonade_server.Lemonade.yaml
builder_args:
- --install-deps-from=flathub
- id: ai.lemonade_server.Lemonade.backends.fastflowlm
arches:
- x86_64
manifest: ai.lemonade_server.Lemonade.backends.fastflowlm/ai.lemonade_server.Lemonade.backends.fastflowlm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
<id>ai.lemonade_server.Lemonade.backends.fastflowlm</id>
<extends>ai.lemonade_server.Lemonade</extends>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<name>FastFlowLM Backend</name>
<summary>AMD Ryzen AI NPU inference backend for Lemonade</summary>
<developer id="com.fastflowlm">
<name>FastFlowLM</name>
</developer>
<icon type="stock">ai.lemonade_server.Lemonade.backends.fastflowlm</icon>
<description>
<p>
This extension adds the FastFlowLM inference backend to Lemonade. Once
installed, Lemonade can select FastFlowLM as one of its backends to serve
large language models directly on AMD Ryzen AI NPUs.
</p>
<p>
FastFlowLM is an NPU-optimized runtime that delivers fast, efficient
language model inference on tile-structured neural processing units. It
provides instant token streaming and support for context windows up to
256k tokens, with multiple AI modalities including reasoning models,
vision, audio, and embeddings.
</p>
</description>
<url type="homepage">https://fastflowlm.com/</url>
<url type="bugtracker">https://github.com/FastFlowLM/FastFlowLM/issues</url>
<provides>
<binary>flm</binary>
</provides>
<releases>
<release version="0.9.43" date="2026-06-09">
<description/>
</release>
</releases>
</component>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
id: ai.lemonade_server.Lemonade.backends.fastflowlm
runtime: ai.lemonade_server.Lemonade
runtime-version: 'stable'

sdk: org.freedesktop.Sdk//25.08
sdk-extensions:
- org.freedesktop.Sdk.Extension.xrt
- org.freedesktop.Sdk.Extension.rust-stable

build-extension: true
separate-locales: false

build-options:
strip: true
no-debuginfo: true

cleanup:
- /lib/cmake
- /lib/pkgconfig
- /include/boost
- '*.a'

modules:
- modules/boost.yaml
- modules/fftw3f.yaml
- modules/fastflowlm.yaml
- name: appdata
buildsystem: simple
build-commands:
- install -Dm0644 ai.lemonade_server.Lemonade.backends.fastflowlm.appdata.xml -t ${FLATPAK_DEST}/share/metainfo
- install -Dm0644 ai.lemonade_server.Lemonade.backends.fastflowlm.png ${FLATPAK_DEST}/share/icons/hicolor/256x256/apps/ai.lemonade_server.Lemonade.backends.fastflowlm.png
sources:
- type: file
path: ai.lemonade_server.Lemonade.backends.fastflowlm.appdata.xml
- type: file
path: ai.lemonade_server.Lemonade.backends.fastflowlm.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -229,18 +229,6 @@
- if(FFTW3_PKG_FOUND)
- target_include_directories(flm PUBLIC ${FFTW3_PKG_INCLUDE_DIRS})
- target_link_libraries(flm PUBLIC ${FFTW3_PKG_LIBRARIES})
- else()
- target_link_libraries(flm PUBLIC fftw3)
- endif()
if(FFTW3F_PKG_FOUND)
target_include_directories(flm PUBLIC ${FFTW3F_PKG_INCLUDE_DIRS})
target_link_libraries(flm PUBLIC ${FFTW3F_PKG_LIBRARIES})
else()
target_link_libraries(flm PUBLIC fftw3f)
endif()
- if(FFTW3L_PKG_FOUND)
- target_include_directories(flm PUBLIC ${FFTW3L_PKG_INCLUDE_DIRS})
- target_link_libraries(flm PUBLIC ${FFTW3L_PKG_LIBRARIES})
- else()
- target_link_libraries(flm PUBLIC fftw3l)
- endif()
@@ -347,9 +331,0 @@
-if(NOT WIN32 AND NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr" AND NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
- install(CODE "
- message(STATUS \"Creating symlink for flm\")
- file(MAKE_DIRECTORY \"$ENV{DESTDIR}/usr/local/bin\")
- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
- \"${CMAKE_INSTALL_PREFIX}/bin/flm\"
- \"$ENV{DESTDIR}/usr/local/bin/flm\")"
- )
-endif()
12 changes: 12 additions & 0 deletions ai.lemonade_server.Lemonade.backends.fastflowlm/modules/boost.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: boost
buildsystem: simple
build-options:
env:
BOOST_JOBS: "-j3"
build-commands:
- ./bootstrap.sh --prefix=$FLATPAK_DEST --with-libraries=atomic,filesystem,program_options,system
- ./b2 -j${FLATPAK_BUILDER_N_JOBS:-4} variant=release threading=multi link=shared,static install
sources:
- type: archive
url: https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.gz
sha256: 205666dea9f6a7cfed87c7a6dfbeb52a2c1b9de55712c9c1a87735d7181452b6
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: fastflowlm
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_NET_OFFLINE: 'true'
build-commands:
- |
export PKG_CONFIG_PATH="${FLATPAK_DEST}/lib/pkgconfig:${FLATPAK_DEST}/share/pkgconfig"
export LDFLAGS="-L${FLATPAK_DEST}/lib -L${FLATPAK_DEST}/lib64 -L/usr/lib/sdk/xrt/lib -L/usr/lib/sdk/xrt/lib64"

cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX="${FLATPAK_DEST}" \
-DFLM_VERSION=0.9.43 \
-DNPU_VERSION=32.0.203.304 \
-DCMAKE_PREFIX_PATH="${FLATPAK_DEST};/usr/lib/sdk/xrt" \
-DXRT_INCLUDE_DIR=/usr/lib/sdk/xrt/include \
-DXRT_LIB_DIR=/usr/lib/sdk/xrt/lib \
-DCMAKE_XCLBIN_PREFIX="${FLATPAK_DEST}/share/flm" \
.
ninja
ninja install
post-install:
- mkdir -p "${FLATPAK_DEST}/lib"
- cp -pv /usr/lib/sdk/xrt/lib/*.so* "${FLATPAK_DEST}/lib/" || true
- cp -pv /usr/lib/sdk/xrt/lib64/*.so* "${FLATPAK_DEST}/lib/" || true
- cp -a /usr/lib/sdk/xrt/lib/xrt "${FLATPAK_DEST}/lib/" 2>/dev/null || true
- chmod a+rX "${FLATPAK_DEST}/bin/flm"
subdir: src
sources:
- type: git
url: https://github.com/FastFlowLM/FastFlowLM.git
commit: 5324dd73162e7005546d287aa4daeceff56e3b2c
- type: patch
path: 0001-fastflowlm-disable-usr-local-symlink.patch
- type: inline
contents: |
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "/run/build/fastflowlm/cargo/vendor"
dest: third_party/tokenizers-cpp/rust/.cargo
dest-filename: config.toml
- generated-flm-cargo-sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: fftw3f
buildsystem: simple
build-commands:
- ./configure --prefix=${FLATPAK_DEST}
--libdir=${FLATPAK_DEST}/lib
--enable-shared --disable-static --enable-threads --enable-float --enable-avx
- make -j${FLATPAK_BUILDER_N_JOBS:-4}
- make install
sources:
- type: archive
url: https://www.fftw.org/fftw-3.3.10.tar.gz
sha256: 56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467
Loading