0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MistralをLM Studioで使えなかった問題とその原因

Last updated at Posted at 2025-10-17

MistralをLM Studioで使えなかった問題とその原因

2025/10/23 編集: 脱字訂正

AIが動かない

LLM(Mistral-7b-instruct-v0.3)をLM Studio経由でインストールして自分のPCに入れて、ローカルLLMとして使おうとした。

問題発生時のPC環境

CPU:Gen 13 Intel Core i7 1355U(Raptor Lake)/10コア
CPUスコア(PassMark):14246
ストレージ容量:M.2 SSD:500GB メモリ容量:16GB
ビデオチップ:Intel Iris Xe Graphics
OS:Windows 11 Home 64bit

↓その時に出た警告文

This message contains no content. The AI has nothing to say.

その時に出た通知内容

Error rendering prompt with jinja template: "Only user and assistant roles are supported!". This is usually an issue with the model's prompt template. If you are using a popular model, you can try to search the model under lmstudio-community, which will have fixed prompt templates. If you cannot find one, you are welcome to post this issue to our discord or issue tracker on GitHub. Alternatively, if you know how to write jinja templates, you can override the prompt template in My Models > model settings > Prompt Template.


何が原因だったのか

LM StudioとLLMとのプロンプトテンプレート(jinja形式)の不整合が原因だったようだ。

要するに、誤ってHugging Face版のモデルをインストールしてしまい、LM Studioからの指示を受け付けなかった。

ChatGPTによる説明

このエラーメッセージ👇

Error rendering prompt with jinja template: "Only user and assistant roles are supported!"

***

は、LM StudioでローカルLLMを実行するときに、モデルのプロンプトテンプレート(Jinja形式)に不整合がある場合に発生する典型的なエラーです。
つまり、「チャット履歴やメッセージ構造をどう組み立てるか」を指定しているテンプレートが、モデルの想定フォーマットと合っていません。


「mistralai/mistral-7b-instruct-v0.3」でそのエラー👇が出ているのですね:

Error rendering prompt with jinja template: "Only user and assistant roles are supported!"

💡 原因

このモデルは 公式Hugging Face版 で、LM Studioが採用するチャットテンプレート(Jinja)が
「systemロール」や「bos/eosトークン」などを前提にしているのに、
LM Studioの内部レンダラーが 「user」「assistant」以外を拒否してしまうためです。


どのように対処したか

Mistralの形式を

mistralai/mistral-7b-instruct-v0.3

から

lmstudio-community/Mistral-7B-Instruct-v0.3-GGUF

に変更したところ、問題無く稼働した。
(一度削除した後、インストールし直した。)

Mistralへの指示と回答
tu peux lire le text en japonais?

mistral-7b-instruct-v0.3
Thought for 21.59 seconds

はい、日本語でこのテキストを読み取ることができます。
私のモデルが日本語を処理できるため、あなたの質問に答えられます。

Can tell me "good bye" in French?

mistral-7b-instruct-v0.3
Thought for 12.38 seconds

Bonjour, au revoir est "good bye" en français.
Pour vous aider à vous souvenir de la traduction, "au revoir" se traduit en anglais par "good bye", et "bonjour" signifie "hello".

tu peux lire ma system prompt?

mistral-7b-instruct-v0.3
Thought for 9.06 seconds

Yes, I can read your system prompt. 
As a model trained on multiple languages, I can process English, but if you have any specific requirements or need assistance with another language, please let me know!

今後気を付けること

  • インストール前にそのアプリケーションに対応した形式のモデルか確認する

  • Model Searchのベストマッチで提案された内容を過信しないこと

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?