[PR #14671] server: skip renderer/parser inheritance when custom template provided #40651

Open
opened 2026-04-23 01:30:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14671
Author: @majiayu000
Created: 3/6/2026
Status: 🔄 Open

Base: mainHead: fix/issue-14560-template-override-renderer


📝 Commits (1)

  • 039149e server: skip renderer inheritance when custom template provided

📊 Changes

2 files changed (+73 additions, -3 deletions)

View changed files

📝 server/create.go (+5 -3)
📝 server/routes_create_test.go (+68 -0)

📄 Description

Summary

  • When creating a model with FROM and a custom TEMPLATE, the parent model's Renderer and Parser were unconditionally inherited
  • Built-in renderers take precedence over templates at inference time, so the custom template was silently ignored
  • Only inherit Renderer/Parser from the parent when the child does not specify its own TEMPLATE

Test plan

  • TestCreateFromModelSkipsRendererParserWithCustomTemplate — verifies renderer/parser are NOT inherited when custom template is provided
  • TestCreateFromModelInheritsRendererParser — existing test still passes (no regression for models without custom template)
  • TestGenerateWithBuiltinRenderer — existing renderer tests still pass

Fixes #14560


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14671 **Author:** [@majiayu000](https://github.com/majiayu000) **Created:** 3/6/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/issue-14560-template-override-renderer` --- ### 📝 Commits (1) - [`039149e`](https://github.com/ollama/ollama/commit/039149e84b2c48b496e79e84ba16e87d26c07109) server: skip renderer inheritance when custom template provided ### 📊 Changes **2 files changed** (+73 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `server/create.go` (+5 -3) 📝 `server/routes_create_test.go` (+68 -0) </details> ### 📄 Description ## Summary - When creating a model with `FROM` and a custom `TEMPLATE`, the parent model's `Renderer` and `Parser` were unconditionally inherited - Built-in renderers take precedence over templates at inference time, so the custom template was silently ignored - Only inherit `Renderer`/`Parser` from the parent when the child does not specify its own `TEMPLATE` ## Test plan - [x] `TestCreateFromModelSkipsRendererParserWithCustomTemplate` — verifies renderer/parser are NOT inherited when custom template is provided - [x] `TestCreateFromModelInheritsRendererParser` — existing test still passes (no regression for models without custom template) - [x] `TestGenerateWithBuiltinRenderer` — existing renderer tests still pass Fixes #14560 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:30:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#40651