Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active January 12, 2025 23:19
Show Gist options
  • Save dacr/341aacd6377349c03b337f4782743de8 to your computer and use it in GitHub Desktop.
Save dacr/341aacd6377349c03b337f4782743de8 to your computer and use it in GitHub Desktop.
flake configuration for ollama / published by https://github.com/dacr/code-examples-manager #e5d0df54-2723-4ad3-aa10-75a4d6b4c869/873371584773ba37f6d7aca198a366945a638923
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils}:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
apps.default = {
type = "app";
program = "${pkgs.ollama-cuda}/bin/ollama";
};
});
}
## summary : flake configuration for ollama
## keywords : nix, flake, ollama, mistral, codestral, llama
## publish : gist
## authors : David Crosson
## license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
## id : e5d0df54-2723-4ad3-aa10-75a4d6b4c869
## created-on : 2024-11-17T18:58:08+01:00
## managed-by : https://github.com/dacr/code-examples-manager
## run-with : make serve
## attachments : flake.nix, flake.lock
OLLAMA?=nix run . --
all:
serve:
${OLLAMA} serve
ps:
${OLLAMA} ps
llama32:
${OLLAMA} run llama3.2
codestral:
${OLLAMA} run codestral
mistral:
${OLLAMA} run mistral
classic-install:
curl -fsSL https://ollama.com/install.sh | sh
echo "INSTALLED IN /usr/local"
classic-install-cuda-nvidia-ubuntu2404:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install cuda-toolkit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment