HNHacker News
TopNewBestAskShowJobs

jmorgan

1,780 karma · joined January 31, 2014

https://github.com/ollama/ollama
submissionscomments
jmorgan··on Ask HN: Has anyone replaced Claude/GPT with a local model for daily coding?
The larger models are available on Ollama's cloud as most folks don't have the hardware to run 500B-1T parameter models.
jmorgan··on Pi – A minimal terminal coding harness
For local models I've been trying it with GLM-4.7-Flash and the new LFM2 24B model. I'm excited to try it with the new Qwen3.5 models that came out today as well.
jmorgan··on Pi – A minimal terminal coding harness
I've been using Pi day to day recently for simple, smaller tasks. It's a great harness for use with smaller parameter size models given the system prompt is quite a bit shorter vs Claude or Codex (and it uses a nice small set of tools by default).
jmorgan··on ollama launch
That's not good, sorry. I work on Ollama - shoot me an email (jeff@ollama.com) and we can help debug
jmorgan··on GLM-4.7-Flash
It's available (with tool parsing, etc.): https://ollama.com/library/glm-4.7-flash but requires 0.14.3 which is in pre-release (and available on Ollama's GitHub repo)
jmorgan··on A guide to local coding models
The source is available here: https://github.com/ollama/ollama/tree/main/app
jmorgan··on Claude Is Down
The gpt-oss weights on Ollama are native mxfp4 (the same weights provided by OpenAI). No additional quantization is applied, so let me know if you're seeing any strange results with Ollama.

Most gpt-oss GGUF files online have parts of their weights quantized to q8_0, and we've seen folks get some strange results from these models. If you're importing these to Ollama to run, the output quality may decrease.

jmorgan··on Ollama Web Search
We did consider building functionality into Ollama that would go fetch search results and website contents using a headless browser or similar. However we had a lot of worries about result quality and also IP blocking from Ollama creating crawler-like behavior. Having a hosted API felt like a fast path to get results into users' context window, but we are still exploring the local option. Ideally you'd be able to stay fully local if you want to (even when using capabilities like search)
jmorgan··on Gemma 3 270M: Compact model for hyper-efficient AI
Amazing work. This model feels really good at one-off tasks like summarization and autocomplete. I really love that you released a quantized aware training version on launch day as well, making it even smaller!
jmorgan··on Ollama Turbo
It should open ollama.com/connect – sorry about that. Feel free to message me jeff@ollama.com if you keep seeing issues
jmorgan··on Open models by OpenAI
Sorry about this. Re-downloading Ollama should fix the error
jmorgan··on Magistral — the first reasoning model by Mistral AI
Working on adding tool calling support to Magistral in Ollama. It requires a tokenizer change and also uses a new tool calling format. Excited to see the results of combining thinking + tool calling!
jmorgan··on Deepseek R1 Distill 8B Q40 on 4 x Raspberry Pi 5
This is a great point. apt-get would definitely be a better install experience and upgrade experience (that's what I would want too). Tailscale does this amazing well: https://tailscale.com/download/linux

The main issue for the maintainer team would be the work in hosting and maintaining all the package repos for apt, yum, etc, and making sure the we handle the case where nvidia/amd drivers aren't installed (quite common on cloud VMs). Mostly a matter of time and putting in the work.

For now every release of Ollama includes a minimal archive with the ollama binary and required dynamic libraries: https://github.com/ollama/ollama/blob/main/docs/linux.md#man.... But we could definitely do better

jmorgan··on Qwen2.5-1M: Deploy your own Qwen with context length up to 1M tokens
Sorry this isn't more obvious. Ideally VRAM usage for the context window (the KV cache) becomes dynamic, starting small and growing with token usage, whereas right now Ollama defaults to a size of 2K which can be overridden at runtime. A great example of this is vLLM's PagedAttention implementation [1] or Microsoft's vAttention [2] which is CUDA-specific (and there are quite a few others).

1M tokens will definitely require a lot of KV cache memory. One way to reduce the memory footprint is to use KV cache quantization, which has recently been added behind a flag [3] and will 1/4 the memory footprint if 4-bit KV cache quantization is used (OLLAMA_KV_CACHE_TYPE=q4_0 ollama serve)

[1] https://arxiv.org/pdf/2309.06180

[2] https://github.com/microsoft/vattention

[3] https://smcleod.net/2024/12/bringing-k/v-context-quantisatio...

jmorgan··on Phi 4 available on Ollama
Phi-4's architecture changed slightly from Phi-3.5 (it no longer uses a sliding window of 2,048 tokens [1]), causing a change in the hyperparameters (and ultimately an error at inference time for some published GGUF files on Hugging Face, since the same architecture name/identifier was re-used between the two models).

For the Phi-4 uploaded to Ollama, the hyperparameters were set to avoid the error. The error should stop occurring in the next version of Ollama [2] for imported GGUF files as well

In retrospect, a new architecture name should probably have been used entirely, instead of re-using "phi3".

[1] https://arxiv.org/html/2412.08905v1

[2] https://github.com/ollama/ollama/releases/tag/v0.5.5

jmorgan··on Fast LLM Inference From Scratch (using CUDA)
Thank you for writing this!
jmorgan··on Gemma 2: Improving Open Language Models at a Practical Size [pdf]
Currently when the context limit is hit, there's a halving of the context window (or a "context shift") to allow inference to continue – this is helpful for smaller (e.g. 1-2k) context windows.

However, not all models (especially newer ones) respond well to this, which makes sense. We're working on changing the behavior in Ollama's API to be more similar to OpenAI, Anthropic and similar APIs so that when the context limit is hit, the API returns a "limit" finish/done reason. Hope this is helpful!

jmorgan··on Gemma 2: Improving Open Language Models at a Practical Size [pdf]
Sorry about this – working on fixing the issue with hitting the context limit. Gemma 2 supports a 8192 context limit – which can be selected if you provide the `num_ctx` parameter in the API or via `ollama run` with `/set parameter num_ctx 8192`
jmorgan··on Ask HN: Why is running Llama3 on Ollama so slow?
Sorry it's slow for you – happy to help debug why - shoot me an email at jeff@ollama.com
jmorgan··on Htmx 2.0.0 has been released
Thank you for building htmx!
jmorgan··on Ollama v0.1.45
Sorry it's taking so long to review and for the radio silence on the PR.

We have been trying to figure out how to support more structured output formats without some of the side effects of grammars. With JSON mode (which uses grammars under the hood) there were originally quite a few issue reports namely around lower performance and cases where the model would infinitely generate whitespace causing requests to hang. This is an issue with OpenAI's JSON mode as well which requires the caller to "instruct the model to produce JSON" [1]. While it's possible to handle edge cases for a single grammar such as JSON (i.e. check for 'JSON' in the prompt), it's hard to generalize this to any format.

Supporting more structured output formats is definitely important. Fine-tuning for output formats is promising, and this thread [2] also has some great ideas and links.

[1] https://platform.openai.com/docs/guides/text-generation/json...

[2] https://github.com/ggerganov/llama.cpp/issues/4218

jmorgan··on Ollama v0.1.45
Pre-release versions are created to test new updates on bunch of different hardware setups (OS/GPUs) before releasing more broadly (and making new versions the default for the Linux/macOS/Windows installers – those pull from the 'latest' release).

There are a good number of folks that test the pre-releases as well (thank you!) especially if there's a bug fix or new feature they are waiting for. "Watch"ing the repo on GitHub will send emails/notifications of new pre-release versions

jmorgan··on Ollama v0.1.45
Not at the moment, although it is a highly requested feature (specifically fine-tuning). There are a few tools that you can (or will soon be able to) use to fine tune a model and then import the resulting adapter layers into Ollama: MLX [1] on macOS, Unsloth [2] on Windows and Linux

[1] https://github.com/ml-explore/mlx

[2] https://github.com/unslothai/unsloth

jmorgan··on What's New in the Windows Subsystem for Linux in May 2024
Shoot sorry about that. There's a few ways to keep the model loaded in memory:

1. If using `ollama run`: `ollama run llama3 --keepalive -1`

2. If running ollama serve directly, use `OLLAMA_KEEP_ALIVE=-1` ollama serve

3. If using the api, there's a `keep_alive` parameter you can set to -1

jmorgan··on Codestral: Mistral's Code Model
Codestral was just published here as well: https://ollama.com/library/codestral
jmorgan··on Ollama v0.1.33 with Llama 3, Phi 3, and Qwen 110B
Yes, we are also looking at integrating MLX [1] which is optimized for Apple Silicon and built by an amazing team of individuals, a few of which were behind the original Torch [2] project. There's also TensorRT-LLM [3] by Nvidia optimized for their recent hardware.

All of this of course acknowledging that llama.cpp is an incredible project with competitive performance and support for almost any platform.

[1] https://github.com/ml-explore/mlx

[2] https://en.wikipedia.org/wiki/Torch_(machine_learning)

[3] https://github.com/NVIDIA/TensorRT-LLM

jmorgan··on Qwen1.5-110B
I think it's worth it, although it might be best to wait for the next iteration: there's rumors the M4 Macs will support up to 512GB of memory [1].

The current 128GB (e.g. M3 Max) and 192GB (e.g. M2 Ultra) Macs run these large models. For example on the M2 Ultra, the Qwen 110B model, 4-bit quantized, gets almost 10 t/s using Ollama [2] and other tools built with llama.cpp.

There's also the benefit of being able to load different models simultaneously which is becoming important for RAG and agent-related workflows.

[1] https://www.macrumors.com/2024/04/11/m4-ai-chips-late-2024/ [2] https://ollama.com/library/qwen:110b

jmorgan··on Meta Llama 3
Sorry about this. It should be fixed now. There was an issue with the vocabulary we had to fix and re-push!

  ollama pull llama3:8b-instruct-q4_0
should update it.
jmorgan··on Embeddings are a good starting point for the AI curious app developer
Support for _some_ embedding models works in Ollama (and llama.cpp - Bert models specifically)

  ollama pull all-minilm

  curl http://localhost:11434/api/embeddings -d '{
    "model": "all-minilm",
    "prompt": "Here is an article about llamas..."
  }'
Embedding models run quite well even on CPU since they are smaller models. There are other implementations with a library form factor like transformers.js https://xenova.github.io/transformers.js/ and sentence-transformers https://pypi.org/project/sentence-transformers/
jmorgan··on Mixtral 8x22B
The `mixtral:8x22b` tag still points to the text completion model – instruct is on the way, sorry!

Update: mixtral:8x22b now points to the instruct model:

  ollama pull mixtral:8x22b
  ollama run mixtral:8x22b
Page 1 of 5Next →