mirror of
https://github.com/ollama/ollama.git
synced 2026-04-17 15:53:27 +02:00
The staleness check compared the local manifest digest (SHA256 of the file on disk) against the registry's Ollama-Content-Digest header. These never matched because PullModel re-serializes the manifest JSON before writing, producing different bytes than the registry's original. The fallback comparison (local modified_at vs upstream push time) was also broken: the generated TypeScript Time class discards the actual timestamp value, so Date parsing always produced NaN. Fix by moving the staleness comparison server-side where we have reliable access to both the local manifest file mtime and the upstream push time. The /api/v1/model/upstream endpoint now returns a simple `stale` boolean instead of raw digests for the frontend to compare. Also adds User-Agent to the CORS allowed headers for dev mode.
Ollama for macOS and Windows
Download
Development
Desktop App
go generate ./... &&
go run ./cmd/app
UI Development
Setup
Install required tools:
go install github.com/tkrajina/typescriptify-golang-structs/tscriptify@latest
Develop UI (Development Mode)
- Start the React development server (with hot-reload):
cd ui/app
npm install
npm run dev
- In a separate terminal, run the Ollama app with the
-devflag:
go generate ./... &&
OLLAMA_DEBUG=1 go run ./cmd/app -dev
The -dev flag enables:
- Loading the UI from the Vite dev server at http://localhost:5173
- Fixed UI server port at http://127.0.0.1:3001 for API requests
- CORS headers for cross-origin requests
- Hot-reload support for UI development
Build
Windows
Dependencies - either build a local copy of ollama, or use a github release
# Local dependencies
.\scripts\deps_local.ps1
# Release dependencies
.\scripts\deps_release.ps1 0.6.8
Build
.\scripts\build_windows.ps1
macOS
CI builds with Xcode 14.1 for OS compatibility prior to v13. If you want to manually build v11+ support, you can download the older Xcode here, extract, then mv ./Xcode.app /Applications/Xcode_14.1.0.app then activate with:
export CGO_CFLAGS="-O3 -mmacosx-version-min=12.0"
export CGO_CXXFLAGS="-O3 -mmacosx-version-min=12.0"
export CGO_LDFLAGS="-mmacosx-version-min=12.0"
export SDKROOT=/Applications/Xcode_14.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
export DEVELOPER_DIR=/Applications/Xcode_14.1.0.app/Contents/Developer
Dependencies - either build a local copy of Ollama, or use a GitHub release:
# Local dependencies
./scripts/deps_local.sh
# Release dependencies
./scripts/deps_release.sh 0.6.8
Build
./scripts/build_darwin.sh