Skip to content

Commit d4a89d7

Browse files
committed
Add 'gemma-3-vision' as chat_format for OpenAI-compatible server.
1 parent 025e7fa commit d4a89d7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

llama_cpp/server/model.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,20 @@ def load_llama_from_model_settings(settings: ModelSettings) -> llama_cpp.Llama:
157157
chat_handler = llama_cpp.llama_chat_format.Llama3VisionAlpha(
158158
clip_model_path=settings.clip_model_path, verbose=settings.verbose
159159
)
160+
elif settings.chat_format == "gemma-3-vision":
161+
assert settings.clip_model_path is not None, "clip model not found"
162+
if settings.hf_model_repo_id is not None:
163+
chat_handler = (
164+
llama_cpp.llama_chat_format.Gemma3ChatHandler.from_pretrained(
165+
repo_id=settings.hf_model_repo_id,
166+
filename=settings.clip_model_path,
167+
verbose=settings.verbose,
168+
)
169+
)
170+
else:
171+
chat_handler = llama_cpp.llama_chat_format.Gemma3ChatHandler(
172+
clip_model_path=settings.clip_model_path, verbose=settings.verbose
173+
)
160174
elif settings.chat_format == "minicpm-v-2.6":
161175
assert settings.clip_model_path is not None, "clip model not found"
162176
if settings.hf_model_repo_id is not None:

0 commit comments

Comments
 (0)