Skip to content

Feat: Add flatpak manifest #4732

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
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
30 changes: 30 additions & 0 deletions flatpak/ai.jan.Jan.extension.cuda12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
id: ai.jan.Jan.extension.cuda
branch: '1.4'
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk//24.08
build-extension: true
separate-locales: false
build-options:
prefix: /app/cuda
prepend-ld-library-path: lib
modules:
- name: cuda-toolkit
only-arches:
- x86_64
cleanup:
- /cuda
buildsystem: simple
build-commands:
- mkdir /app/cuda
- sh cuda_toolkit.run --silent --toolkit --toolkitpath=/app/cuda
- mv /app/cuda/lib64/libcudart.* /app/lib/
- mv /app/cuda/lib64/libcublas* /app/lib/
sources:
- type: file
only-arches:
- x86_64
url: https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_570.86.10_linux.run
dest-filename: cuda_toolkit.run
md5: c71027cf1a4ce84f80b9cbf81116e767

71 changes: 71 additions & 0 deletions flatpak/ai.jan.Jan.extension.vulkan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
id: ai.jan.Jan.extension.vulkan
branch: '1.4'
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk//24.08
build-extension: true
separate-locales: false
build-options:
prefix: /app/lib/GL/vulkan
prepend-ld-library-path: lib
modules:
- name: volk
buildsystem: cmake-ninja
builddir: true
config-opts:
- -DVOLK_INSTALL=ON
sources:
- type: archive
url: https://github.com/zeux/volk/archive/refs/tags/vulkan-sdk-1.3.280.0.zip
sha256: 178875134d36e8b90f7e3ec31171355df3b71f47eba49cca2f98158e6552b011

- name: vulkan-headers
buildsystem: cmake-ninja
builddir: true
sources:
- type: archive
url: https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.283.zip
sha256: 2094159c87fb4b6d8f734bd4cad59564cef7ef32feb00cf6d8ca7e75a84df921

- name: vulkan-tools
buildsystem: cmake-ninja
builddir: true
sources:
- type: archive
url: https://github.com/KhronosGroup/Vulkan-Tools/archive/refs/tags/v1.3.283.zip
sha256: 11ec6b474e91dc8cb6e7f22891294ede549bb6ed67c19d230e293b3fc9610883


- name: shaderc
buildsystem: cmake-ninja
builddir: true
config-opts:
- -DSHADERC_SKIP_COPYRIGHT_CHECK=ON
- -DSHADERC_SKIP_EXAMPLES=ON
- -DSHADERC_SKIP_TESTS=ON
- -DSPIRV_SKIP_EXECUTABLES=ON
- -DENABLE_GLSLANG_BINARIES=OFF
cleanup:
- /bin
- /include
- /lib/cmake
- /lib/pkgconfig
sources:
- type: git
url: https://github.com/google/shaderc.git
tag: v2024.1
commit: 47a9387ef5b3600d30d84c71ec77a59dc7db46fa
# https://github.com/google/shaderc/blob/known-good/known_good.json
- type: git
url: https://github.com/KhronosGroup/SPIRV-Tools.git
commit: dd4b663e13c07fea4fbb3f70c1c91c86731099f7
dest: third_party/spirv-tools
- type: git
url: https://github.com/KhronosGroup/SPIRV-Headers.git
commit: 5e3ad389ee56fca27c9705d093ae5387ce404df4
dest: third_party/spirv-headers
- type: git
url: https://github.com/KhronosGroup/glslang.git
commit: 142052fa30f9eca191aa9dcf65359fcaed09eeec
dest: third_party/glslang

47 changes: 47 additions & 0 deletions flatpak/ai.jan.Jan.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>ai.jan.Jan</id>
<metadata_license>FSFAP</metadata_license>
<project_license>AGPL-3.0-only</project_license>
<developer_name>Menlo Research</developer_name>
<name>Jan</name>
<icon type="stock">ai.jan.Jan</icon>
<summary>Local AI Assistant that runs 100% offline on your device</summary>
<categories>
<category>Utility</category>
<category>Education</category>
<category>Chat</category>
<category>Dictionary</category>
</categories>
<description>
<p>
Jan is a ChatGPT-alternative that runs 100% offline on your device. Our goal is to make it easy for anyone to download and run LLMs and use AI with full control and privacy.
</p>
<p>Features:</p>
<ul>
<li>Model Library with popular LLMs like Llama, Gemma, Mistral, or Qwen</li>
<li>Connect to Remote AI APIs like Groq and OpenRouter</li>
<li>Local API Server with OpenAI-equivalent API</li>
<li>Extensions for customizing Jan</li>
</ul>
</description>
<launchable type="desktop-id">ai.jan.Jan.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://catalog.jan.ai/flatpak/demo.gif</image>
</screenshot>
</screenshots>

<url type="homepage">https://jan.ai/</url>
<url type="bugtracker">https://github.com/janhq/jan/issues</url>

<content_rating type="oars-1.1" />

<releases>
<release version="0.5.12" date="2024-01-02">
<description>
<p>Latest stable release of Jan AI</p>
</description>
</release>
</releases>
</component>
40 changes: 40 additions & 0 deletions flatpak/ai.jan.Jan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
id: ai.jan.Jan
runtime: org.gnome.Platform
runtime-version: '48'
sdk: org.gnome.Sdk
add-extensions:
org.freedesktop.Platform.GL.cuda:
version: '1.4'
directory: lib/GL/cuda-12.3
add-ld-path: lib
org.freedesktop.Platform.GL.vulkan:
version: '1.4'
directory: lib/GL/vulkan
add-ld-path: lib
command: Jan
finish-args:
- --socket=wayland # Permission needed to show the window
- --socket=fallback-x11 # Permission needed to show the window on X11
- --device=dri
- --share=ipc

modules:
- name: binary
buildsystem: simple
sources:
- type: file
url: https://github.com/menloresearch/jan/releases/download/untagged-952b0124754621e9805e/Jan_0.6.0_amd64.deb
sha256: 641316bbb92d0509f07366a636e3d902d81ac1d728a3975198bda74f21e61d9a
only-arches: [x86_64]
build-commands:
- ar -x *.deb
- tar -xf data.tar.gz
- 'install -Dm755 usr/bin/Jan /app/bin/Jan'
- 'install -Dm755 usr/bin/cortex-server /app/bin/cortex-server'
- 'install -Dm755 usr/bin/bun /app/bin/bun'
- 'install -Dm755 usr/bin/bun /app/bin/uv'
- install -Dm644 usr/share/applications/Jan.desktop /app/share/applications/ai.jan.Jan.desktop
- install -Dm644 usr/share/icons/hicolor/128x128/apps/jan.png /app/share/icons/hicolor/128x128/apps/ai.jan.Jan.png
- install -Dm644 usr/share/icons/hicolor/32x32/apps/jan.png /app/share/icons/hicolor/32x32/apps/ai.jan.Jan.png
- install -Dm644 usr/share/icons/hicolor/256x256@2/apps/jan.png /app/share/icons/hicolor/256x256@2/apps/ai.jan.Jan.png
- install -Dm644 ai.jan.Jan.metainfo.xml /app/share/metainfo/ai.jan.Jan.rosary.metainfo.xml