{"id":17512996,"url":"https://github.com/man2dev/go-ollama","last_synced_at":"2026-01-30T02:45:26.169Z","repository":{"id":247792905,"uuid":"826864891","full_name":"Man2Dev/go-ollama","owner":"Man2Dev","description":"Packaging Ollama for Fedora linux","archived":false,"fork":false,"pushed_at":"2024-12-04T20:03:25.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T04:52:49.523Z","etag":null,"topics":["ai","fedora","fedora-linux","go","golang","linux","linux-app","llama-cpp","llamacpp","llm","llms","local-ai","ollama"],"latest_commit_sha":null,"homepage":"https://gitlab.com/fedora/sigs/ai-ml/go-ollama","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Man2Dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T14:30:15.000Z","updated_at":"2024-12-04T20:03:29.000Z","dependencies_parsed_at":"2024-08-27T20:24:33.862Z","dependency_job_id":"fb6d9154-2d69-477b-80f3-06c666e594dc","html_url":"https://github.com/Man2Dev/go-ollama","commit_stats":{"total_commits":80,"total_committers":2,"mean_commits":40.0,"dds":"0.012499999999999956","last_synced_commit":"1ac1b189ae4f490bf03af4c8daf9efb5fd2d7794"},"previous_names":["man2dev/ollama","man2dev/go-ollama"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Man2Dev%2Fgo-ollama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Man2Dev%2Fgo-ollama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Man2Dev%2Fgo-ollama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Man2Dev%2Fgo-ollama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Man2Dev","download_url":"https://codeload.github.com/Man2Dev/go-ollama/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345291,"owners_count":21088243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","fedora","fedora-linux","go","golang","linux","linux-app","llama-cpp","llamacpp","llm","llms","local-ai","ollama"],"created_at":"2024-10-20T06:06:33.268Z","updated_at":"2026-01-30T02:45:26.139Z","avatar_url":"https://github.com/Man2Dev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ollama packaging for fedora\n\n## build locally\n\nin the v0.3.6 build of ollama relies on a .so file that is linked in /lib\nhowever in Fedora x86_64 libraries usually are in /lib64 as such need to be\nrecompiled as to run on fedora.\n\n**Build documentation in:**\n\n- \u003chttps://github.com/ollama/ollama/tree/main/docs/development.md\u003e\n\n**Build Scripts:**\n\n- `scripts/rh_linux_deps.sh`\n- `scripts/env.sh`\n\n**Install Scripts**\n\n- \u003chttps://github.com/ollama/ollama/blob/main/scripts/install.sh\u003e\n\n## Manual:\n\n1.  **build:**\n\n```bash\ngit clone --recurse-submodules git@github.com:ollama/ollama.git\ncd ollama\nOLLAMA_CUSTOM_CPU_DEFS=\"-DGGML_AVX=off -DGGML_AVX2=off -DGGML_F16C=off -DGGML_FMA=off\" go generate ./...\ngo build .\n```\n2.  **install:**\n\n\u003e Note: assumed that developer is inside local ollama folder.\n\n```bash\n# based of https://github.com/ollama/ollama/blob/main/docs/linux.md\n\n# make ollama user\n```bash\nsudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama\nsudo usermod -a -G ollama $(whoami)\n```\n# write Ollama service\n\n```bash\nsudo echo -e '[Unit]\\nDescription=Ollama service\\nAfter=network-online.target\\n\\n[Service]\\nExecStart=/usr/bin/ollama serve\\nUser=ollama\\nGroup=ollama\\nRestart=on-failure\\nRestartSec=3\\n\\Environment=\"PATH=$PATH\"n[Install]\\nWantedBy=multi-user.target' \u003e /etc/systemd/system/ollama.service\n```\n# enable and start service\n\n```bash\nsudo systemctl daemon-reload\nsudo systemctl enable ollama\nsudo systemctl start ollama\n```\n- TODO\n\n```\n\n\n## Cuda:\n**Note: I will not be doing a cuda build for fedora this are just general instructions**\n\n\n**check what cuda aversion you have:**\n\n\ncan be checked with `nvidia-smi`\nor this script that should output your cuda version:\n```bash\nnvidia-smi -q | awk '$0 ~ /CUDA Version[^\\n]*/ {print $4}'\n```\nyou can find full list of nvida container on:\n\n**regestry:**\n\n\u003chttps://hub.docker.com/r/nvidia/cuda/tags\u003e\n\n\u003chttps://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda\u003e\n\n**ollama docker images**\n\n\u003chttps://hub.docker.com/r/ollama/ollama\u003e\n\n**git repo:**\n\nhttps://gitlab.com/nvidia/container-images/cuda/-/tree/master/dist\n\n* then build with `nvidia-container-toolkit`\n\n## rpm spec info:\n**%{_userunitdir} \u0026 %{_unitdir} is used for alreadey build systemd services:**\n\n- `rpm --eval %{_userunitdir}`\n- e.g. `%{_userunitdir}/ollama.service` \n\n**Permissions and Ownership / Users and Groups**\n\n- https://rpm-software-management.github.io/rpm/manual/spec.html#files-section\n- https://rpm-software-management.github.io/rpm/manual/users_and_groups.html\n### Additional documentation:\n    + [Fedora user \u0026 group] (https://docs.fedoraproject.org/en-US/packaging-guidelines/#_users_and_groups)\n    + [Fedora systemd] (https://docs.fedoraproject.org/en-US/packaging-guidelines/Systemd/#definitions)\n    + [systemd sysusers.d] (https://www.freedesktop.org/software/systemd/man/latest/sysusers.d.html)\n    + [systemd dynamic users] (https://0pointer.net/blog/dynamic-users-with-systemd.html)\n\n## dependencies needed for project\n\n- \u003chttps://github.com/spf13/cobra\u003e\n\n### go.mod packages\n\n        github.com/bytedance/sonic v1.11.6 // indirect\n        github.com/gabriel-vasile/mimetype v1.4.3 // indirect\n        github.com/gin-contrib/cors v1.7.2\n        github.com/gin-contrib/sse v0.1.0 // indirect\n        github.com/go-playground/locales v0.14.1 // indirect\n        github.com/go-playground/universal-translator v0.18.1 // indirect\n        github.com/go-playground/validator/v10 v10.20.0 // indirect\n        github.com/goccy/go-json v0.10.2 // indirect\n        github.com/inconshreveable/mousetrap v1.1.0 // indirect\n        github.com/json-iterator/go v1.1.12 // indirect\n        github.com/klauspost/cpuid/v2 v2.2.7 // indirect\n        github.com/leodido/go-urn v1.4.0 // indirect\n        github.com/mattn/go-isatty v0.0.20 // indirect\n        github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd //\n    indirect\n        github.com/modern-go/reflect2 v1.0.2 // indirect\n        github.com/pelletier/go-toml/v2 v2.2.2 // indirect\n        github.com/spf13/pflag v1.0.5 // indirect\n        github.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n        github.com/ugorji/go/codec v1.2.12 // indirect\n        golang.org/x/arch v0.8.0 // indirect\n        golang.org/x/crypto v0.23.0\n        golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa\n        golang.org/x/net v0.25.0 // indirect\n        golang.org/x/sys v0.20.0\n        golang.org/x/term v0.20.0\n        golang.org/x/text v0.15.0\n        google.golang.org/protobuf v1.34.1\n        gopkg.in/yaml.v3 v3.0.1 // indirect\n        github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 //\n    indirect\n        github.com/bytedance/sonic/loader v0.1.1 // indirect\n        github.com/chewxy/hm v1.0.0 // indirect\n        github.com/chewxy/math32 v1.10.1 // indirect\n        github.com/cloudwego/base64x v0.1.4 // indirect\n        github.com/cloudwego/iasm v0.2.0 // indirect\n        github.com/davecgh/go-spew v1.1.1 // indirect\n        github.com/gogo/protobuf v1.3.2 // indirect\n        github.com/google/flatbuffers v24.3.25+incompatible // indirect\n        github.com/kr/text v0.2.0 // indirect\n        github.com/pkg/errors v0.9.1 // indirect\n        github.com/pmezard/go-difflib v1.0.0 // indirect\n        github.com/rivo/uniseg v0.2.0 // indirect\n        github.com/xtgo/set v1.0.0 // indirect\n        go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6\n    // indirect\n        golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect\n        gonum.org/v1/gonum v0.15.0 // indirect\n        gorgonia.org/vecf32 v0.9.0 // indirect\n        gorgonia.org/vecf64 v0.9.0 // indirect\n        github.com/agnivade/levenshtein v1.1.1\n        github.com/d4l3k/go-bfloat16 v0.0.0-20211005043715-690c3bdd05f1\n        github.com/google/go-cmp v0.6.0\n        github.com/mattn/go-runewidth v0.0.14\n        github.com/nlpodyssey/gopickle v0.3.0\n        github.com/pdevine/tensor v0.0.0-20240510204454-f88f4562727c\n        github.com/containerd/console v1.0.3\n        github.com/emirpasic/gods v1.18.1\n        github.com/gin-gonic/gin v1.10.0\n        github.com/golang/protobuf v1.5.4 // indirect\n        github.com/google/uuid v1.1.2\n        github.com/olekukonko/tablewriter v0.0.5\n        github.com/spf13/cobra v1.7.0\n        github.com/stretchr/testify v1.9.0\n        github.com/x448/float16 v0.8.4\n        golang.org/x/sync v0.3.0\n\n## Address model location:\n\n- store models in %_sharedstatedir/ollama instead of /usr/share/ollama/\n- look in to xdg portal use for Home directory:\n    1.  \u003chttps://github.com/ollama/ollama/pull/897\u003e\n    2.  \u003chttps://github.com/ollama/ollama/issues/228\u003e\n\n## support x86_64-v{1,2,3,4} cpu generations in llama-cpp or other packages:\n\n1. **Dynamic Spec Generation**\n    - https://rpm-software-management.github.io/rpm/manual/dynamic_specs.html\n\n2. **Architecture-specific support.  Internal.  Do not use directly.**\n    - found in `/usr/lib/rpm/redhat/macros` in `RPM 4.20.0`/`f41\u003e=`\n    - \n```rpmspec\n%__cflags_arch_x86_64_level %[0%{?rhel} == 9 ? \"-v2\" : \"\"]%[0%{?rhel} \u003e 9 ? \"-v3\" : \"\"]\n%__cflags_arch_x86_64 -march=x86-64%{?__cflags_arch_x86_64_level:%{__cflags_arch_x86_64_level}}\n\n# -mtls-dialect=gnu2 is currently specific to GCC (#2263181).\n%__cflags_arch_x86_64_common -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection %[ \"%{toolchain}\" == \"gcc\" ? \"-mtls-dialect=gnu2 \" : \"\" ]%{_frame_pointers_cflags} %{_frame_pointers_cflags_x86_64}\n\n# Also used for s390.\n%__cflags_arch_s390x %[0%{?rhel} \u003e= 9 ? \"-march=z14 -mtune=z15\" : \"-march=z13 -mtune=z14\"]\n\n%__cflags_arch_ppc64le %[0%{?rhel} \u003e= 9 ? \"-mcpu=power9 -mtune=power9\" : \"-mcpu=power8 -mtune=power8\"]\n```\n\n3.  **SDL3 in llama-cpp**\n\nupstream the use of:\n\n    1. https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_cpuinfo.h\n    2. https://github.com/libsdl-org/SDL/blob/main/src/cpuinfo/SDL_cpuinfo.c\n\n- reference: \u003chttps://github.com/libsdl-org/SDL/blob/main/CMakeLists.txt\u003e\n\n4. **Fedora ENL**\n\nELN allows us to explore new ideas like a higher baseline for CPU architectures in a way that will not disrupt the rest of Fedora.\n\n- https://docs.fedoraproject.org/en-US/eln\n- https://docs.fedoraproject.org/en-US/eln/buildroot\n- https://fedoraproject.org/wiki/Changes/Additional_buildroot_to_test_x86-64_micro-architecture_update\n- https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/3Z5SMF6CPL3MK2CNYPUW4OZYMA6TZJBN/#MKXPMQOZNLECPPWRM6UBUMR2WHVG5DL6\n- https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/IFBHS2WKKPKJH6H54OX4DV3U7A4XYOPU/#LUWYM7CBG5LVB2MFPO3R3JQEBFCPYPLK\n\n5. **gnu**\n\n- https://sourceware.org/legacy-ml/gnu-gabi/2016-q4/msg00000.html\n    + found on https://fedoraproject.org/wiki/Toolchain/Watermark\n- gcc build flags https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md\n\n```\nset_option(SDL_ASSEMBLY            \"Enable assembly routines\" ${SDL_ASSEMBLY_DEFAULT})\ndep_option(SDL_AVX                 \"Use AVX assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_AVX2                \"Use AVX2 assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_AVX512F             \"Use AVX512F assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_SSE                 \"Use SSE assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_SSE2                \"Use SSE2 assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_SSE3                \"Use SSE3 assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_SSE4_1              \"Use SSE4.1 assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_SSE4_2              \"Use SSE4.2 assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_MMX                 \"Use MMX assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64\" OFF)\ndep_option(SDL_ALTIVEC             \"Use Altivec assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_POWERPC32 OR SDL_CPU_POWERPC64\" OFF)\ndep_option(SDL_ARMSIMD             \"Use SIMD assembly blitters on ARM\" OFF \"SDL_ASSEMBLY;SDL_CPU_ARM32\" OFF)\ndep_option(SDL_ARMNEON             \"Use NEON assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_ARM32 OR SDL_CPU_ARM64\" OFF)\ndep_option(SDL_LSX                 \"Use LSX assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_LOONGARCH64\" OFF)\ndep_option(SDL_LASX                \"Use LASX assembly routines\" ON \"SDL_ASSEMBLY;SDL_CPU_LOONGARCH64\" OFF)\n\n```\n4.  **At runtime:**\n- \u003chttps://github.com/google/cpu_features\u003e\n5.  **Mailing list with useful info:**\n- \n  https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/EA6Y5AUE5DQ4WTD225L4UYMVXFTTK5UV/\n6.  **NDK:**\n- \n  https://android.googlesource.com/platform/ndk/+/main/sources/android/cpufeatures/cpu-features.h\n7.  **Archive reference:**\n    1.  \u003chttps://github.com/intel/sgx-cpu-feature-detection/blob/master/README.md\u003e\n    2.  \u003chttps://github.com/PhilipLudington/poshlib\u003e\n8.  **important conclusions:**\n    1.  dnf does support building for multiple cpu generation through --target\n        x86_64_v?\n    2.  some changes needed to llama-cpp spec\n    3.  Possibly [Runtime scriptlet expansion] (https://rpm-software-management.github.io/rpm/manual/scriptlet_expansion.html)\n\n## notes:\nget cpu features:\n\n```bash\ncat /proc/cpuinfo | grep flags | head -1\n```\n\n~~**this may help with quantization:**~~\n\n~~\u003chttps://github.com/ggerganov/llama.cpp/pull/8713\u003e~~\n\n~~**Ollama builds in differnt directories:**~~\n\n~~ollama/llm/build/linux/amd64/~~\n\n## rpm access control\n    - https://rpm-software-management.github.io/rpm/manual/lua.html#posix-extension\n\n## Hardware Acceleration:\n\n1.  **Rocm:**\n- Will most likly be in Fedora 42 thanks to Tom\n2.  **Vulkan:**\n- still in development in llama.cpp too soon to be added\n- shaderc package needed REF: ``\n\n**Vulkan issues in Fedora:**\n\n- \u003chttps://bugzilla.redhat.com/show_bug.cgi?id=2314042\u003e\n- Needs expose \"VK_DRIVER_FILES=/usr/share/vulkan/icd.d/nvidia_icd.json\"\n  + with environment.d \n    \u003chttps://www.man7.org/linux/man-pages/man5/environment.d.5.html\u003e\n  + or with setenv \u003chttps://man7.org/linux/man-pages/man3/setenv.3.html\u003e\n\n**find problems with:**\n\n- libnvidia-vulkan-producer.so\n- libnvidia-allocator.so\n- controlD64\n- vulkan/icd.d/nvidia_layers.json\n\n## Adding possible security features:\n\n1.  Remove all 0.0.0.0 interfaces: http://0.0.0.0 https://0.0.0.0 \n    http://0.0.0.0:* https://0.0.0.0:*\n  + maybe able to fix with Environment verible:\n  + \n    \u003chttps://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux\u003e\n  + based onllama/common.cpp can be fixed by setting LLAMA_ARG_HOST evniroment\n    varible\n2.  UsersAndGroups: \n    \u003chttps://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/\u003e\n3.  capabilities: \u003chttps://man7.org/linux/man-pages/man7/capabilities.7.html\u003e\n4.  the systemd service will be isolated to ollama wheel group with out\n    breaking functionality (read permission neads to be keapt).\n  + Check out rpmconf\n  + gidelines:\n    https://docs.fedoraproject.org/en-US/packaging-guidelines/#_users_and_groups\n  + systemd: \n    \u003chttps://docs.fedoraproject.org/en-US/packaging-guidelines/Systemd/#definitions\u003e\n\n## Idea/Question\n\n- should ollama's registry be patched out?\n  + https://registry.ollama.ai/v2/library/{model}/manifests/latest\n- use ollama cmake to link with lamma-cpp-devel cmake as to build client\n  packages like: llama-cpp-rpc, llama-ccp-server and custom patches \n  \u003chttps://github.com/ollama/ollama/tree/main/llm/patches\u003e\n- Notes:\n  + Check out rpmconf\n  + go generation will use \n    \u003chttps://github.com/ollama/ollama/blob/main/llm/generate/gen_linux.sh\u003e\n  + scripts:  \u003chttps://github.com/ollama/ollama/tree/main/scripts\u003e\n  + Go runner:    \n    \u003chttps://github.com/ollama/ollama/blob/main/docs/development.md\u003e\n\n~~test to see if we can just link ~~ollama serve~~ to ~~llama-cpp-server~~.~~\n\n- remove ssh keys (try to use llama-cpp cilent which will use curl to grab\n  model form Hugging Face)\n  + patching:\n    https://docs.fedoraproject.org/en-US/packaging-guidelines/#_patch_guidelines\n\n~~- patch out auto updating model functionality as to not connect to the internet\nwithout explicit user permission.~~\n\n~~- setup cron for auto update functionality~~\n\n~~+ https://docs.fedoraproject.org/en-US/packaging-guidelines/#_cron_files~~\n\n~~+ \u003chttps://docs.fedoraproject.org/en-US/packaging-guidelines/CronFiles/\u003e~~\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fman2dev%2Fgo-ollama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fman2dev%2Fgo-ollama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fman2dev%2Fgo-ollama/lists"}