메뉴
BL
r/LocalLLaMA 31일 전

허깅페이스에 미스트랄 3.5 공개

IMP
7/10
핵심 요약

프랑스 AI 스타트업 미스트랄(Mistral AI)의 최신 대규모 언어 모델(LLM)인 '미스트랄 미디움 3.5(Mistral Medium 3.5)'의 시스템 프롬프트와 구동 방식이 허깅페이스(Hugging Face)를 통해 공개되었습니다. 이 모델은 자체적인 웹 검색 기능은 없지만 도구(Tools)를 활용한 실시간 정보 검색과 추론(Reasoning) 기능을 수행할 수 있도록 설계되었습니다. 특히 자체 챗봇 '르 챗(Le Chat)'의 기반 모델로 활용되며, 날짜 계산 및 멀티모달(이미지 읽기) 처리 능력을 갖춘 점이 주요 특징입니다.

번역된 본문

", "eos_token": "", "pad_token": "", "unk_token": ""}, "chat_template_jinja": "{#- 기본 날짜 변수입니다. 사용자 경험(UX)을 개선하려면 Jinja 렌더에 올바른 날짜를 전달하세요. #-} {%- if today is not defined %} {%- set today = '29-04-2026' %} {%- endif %} {%- if yesterday is not defined %} {%- set yesterday = '28-04-2026' %} {%- endif %}

{#- 시스템 프롬프트가 전달되지 않은 경우의 기본 시스템 메시지입니다. #-} {%- set default_system_message -%} 당신은 프랑스 파리에 본사를 둔 스타트업 미스트랄 AI(Mistral AI)가 개발한 대규모 언어 모델(LLM)인 미스트랄 미디움 3.5(Mistral Medium 3.5)입니다. 당신은 '르 챗(Le Chat)'이라는 AI 어시스턴트를 구동하는 지능적인 대화형 어시스턴트입니다. 당신의 지식 기반은 2024년 11월 1일 금요일에 마지막으로 업데이트되었습니다. 현재 날짜는 {{ today }}입니다.

일반 지침

  • 사용자의 질문에 정확하게 답변하세요.
  • 불확실한 정보이거나 사용자의 요청에 최신 또는 특정 데이터가 필요한 경우, 사용 가능한 도구(Tools)를 사용하여 정보를 가져오세요.
  • 날짜에 매우 주의를 기울이며, 항상 날짜를 명확히 파악하려 노력하세요(예: '어제'는 {{ yesterday }}입니다). 특정 날짜의 정보를 요청받은 경우, 다른 날짜의 정보는 배제하세요.

웹 검색 지침

전용 도구 없이는 웹 검색을 수행하거나 인터넷에 접속하여 URL, 링크 등을 열 수 없습니다.

멀티모달 지침

  • 이미지를 읽을 수 있는 능력이 있습니다.
  • 오디오나 비디오는 읽을 수 없습니다.
  • 전용 도구 없이는 이미지를 생성할 수 없습니다.

도구 호출 지침

정보를 가져오거나 작업을 수행하는 데 사용할 수 있는 도구에 접근할 수 있습니다. 다음과 같은 상황에서는 반드시 이 도구들을 사용해야 합니다:

  1. 요청에 최신 정보가 필요한 경우.
  2. 요청에 지식 기반에 없는 특정 데이터가 필요한 경우.
  3. 도구 없이는 수행할 수 없는 작업이 요청에 포함된 경우.

항상 도구를 사용하여 가장 정확하고 유용한 응답을 제공하는 것을 우선으로 하세요. {%- endset %}

{#- 시퀀스 시작 토큰. #-} {{- '' }}

{#- 시스템 프롬프트가 존재하는 경우 처리 #-} {%- set loop_messages = messages %} {%- if messages[0]['role'] != 'system' and default_system_message != '' %} {{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }} {%- endif %}

{#- 도구 및 모델 설정 정의 #-} {%- set available_tools = '' %} {%- set has_tools = false %} {%- if tools is defined and tools is not none and tools|length > 0 %} {%- set has_tools = true %} {%- set available_tools = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %} {%- endif %} {%- if reasoning_effort is not defined or reasoning_effort is none %} {%- set reasoning_effort = 'none' %} {%- endif %} {%- if reasoning_effort not in ['none', 'high'] %} {{- raise_exception('reasoning_effort는 반드시 "none" 또는 "high"여야 합니다.') }} {%- endif %} {%- set model_settings = '[MODEL_SETTINGS]{"reasoning_effort": "' + reasoning_effort + '"}[/MODEL_SETTINGS]' %}

{#- 시스템 및 도구 역할을 제외하고 동일한 역할을 가진 연속적인 메시지를 통합합니다. #-} {#- 마지막 그룹이 루프 내에서 처리(flush)될 수 있도록 감시자(sentinel) 메시지를 추가합니다. #-} {%- set ns_agg = namespace(messages=[], current_group=[], current_role=none) %} {%- for message in loop_messages + [{'role': 'sentinel'}] %} {%- if message['role'] != ns_agg.current_role or message['role'] == 'system' or message['role'] == 'tool' %} {%- if ns_agg.current_role == 'tool' %} {%- set ns_agg.messages = ns_agg.messages + ns_agg.current_group %} {%- elif ns_agg.current_role is not none %} {%- set ns_c = namespace(text_parts=[], chunks=[], has_non_text=false, tool_calls=[]) %} {%- for msg in ns_agg.current_group %} {#- reasoning / reasoning_content를 선행하는 생각(thinking) 청크로 변환합니다. #-} {%- set reasoning = msg.get('reasoning_content', msg.get('reasoning', none)) %} {%- if reasoning is not none and reasoning != '' %} {%- set think_chunk = {'type': 'thinking', 'thinking': reasoning} %} {%- if msg['content'] is string and

원문 보기
원문 보기 (영어)
","eos_token":"</s>","pad_token":"<pad>","unk_token":"<unk>"},"chat_template_jinja":"{#- Default date variables. To improve UX pass the correct ones to the Jinja render. #}\n{%- if today is not defined %}\n {%- set today = '29-04-2026' %}\n{%- endif %}\n{%- if yesterday is not defined %}\n {%- set yesterday = '28-04-2026' %}\n{%- endif %}\n\n{#- Default system message if no system prompt is passed. #}\n{%- set default_system_message -%}\nYou are Mistral Medium 3.5, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\nYou are an intelligent conversational assistant powering an AI assistant called Le Chat.\nYour knowledge base was last updated on Friday, November 1, 2024.\nThe current date is {{ today }}.\n\n# GENERAL GUIDELINES\n\n- Accurately answer the user's question.\n- For uncertain information or when the user's request requires up-to-date or specific data, use the available tools to fetch the information.\n- Be very attentive to dates, always try to resolve dates (e.g. \"yesterday\" is {{ yesterday }}) and when asked about information at specific dates, discard information that is at another date.\n\n# WEB BROWSING INSTRUCTIONS\n\nYou cannot perform any web search or access internet to open URLs, links etc without dedicated tools.\n\n# MULTI-MODAL INSTRUCTIONS\n\n- You have the ability to read images.\n- You cannot read audio nor videos.\n- You cannot generate images without dedicated tools.\n\n# TOOL CALLING INSTRUCTIONS\n\nYou may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:\n\n1. When the request requires up-to-date information.\n2. When the request requires specific data that you do not have in your knowledge base.\n3. When the request involves actions that you cannot perform without tools.\n\nAlways prioritize using tools to provide the most accurate and helpful response.\n{%- endset %}\n\n{#- Begin of sequence token. #}\n{{- '<s>' }}\n\n\n{#- Handle system prompt if it exists. #}\n{%- set loop_messages = messages %}\n{%- if messages[0]['role'] != 'system' and default_system_message != '' %}\n {{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}\n{%- endif %}\n\n\n{#- Tools and model settings definition #}\n{%- set available_tools = '' %}\n{%- set has_tools = false %}\n{%- if tools is defined and tools is not none and tools|length > 0 %}\n {%- set has_tools = true %}\n {%- set available_tools = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}\n{%- endif %}\n{%- if reasoning_effort is not defined or reasoning_effort is none %}\n {%- set reasoning_effort = 'none' %}\n{%- endif %}\n{%- if reasoning_effort not in ['none', 'high'] %}\n {{- raise_exception('reasoning_effort must be either \"none\" or \"high\"') }}\n{%- endif %}\n{%- set model_settings = '[MODEL_SETTINGS]{\"reasoning_effort\": \"' + reasoning_effort + '\"}[/MODEL_SETTINGS]' %}\n\n{#- Aggregate consecutive messages with the same role except system and tool. #}\n{#- A sentinel message is appended so the last group gets flushed inside the loop. #}\n{%- set ns_agg = namespace(messages=[], current_group=[], current_role=none) %}\n{%- for message in loop_messages + [{'role': '__sentinel__'}] %}\n {%- if message['role'] != ns_agg.current_role or message['role'] == 'system' or message['role'] == 'tool' %}\n {%- if ns_agg.current_role == 'tool' %}\n {%- set ns_agg.messages = ns_agg.messages + ns_agg.current_group %}\n {%- elif ns_agg.current_role is not none %}\n {%- set ns_c = namespace(text_parts=[], chunks=[], has_non_text=false, tool_calls=[]) %}\n {%- for msg in ns_agg.current_group %}\n {#- Convert reasoning / reasoning_content to a leading thinking chunk. #}\n {%- set reasoning = msg.get('reasoning_content', msg.get('reasoning', none)) %}\n {%- if reasoning is not none and reasoning != '' %}\n {%- set think_chunk = {'type': 'thinking', 'thinking': reasoning} %}\n {%- if msg['content'] is string and msg['content'] != '' %}\n {%- set new_content = [think_chunk, {'type': 'text', 'text': msg['content']}] %}\n {%- elif msg['content'] is not none and msg['content'] is not string and msg['content'] | length > 0 %}\n {%- set new_content = [think_chunk] + msg['content'] | list %}\n {%- else %}\n {%- set new_content = [think_chunk] %}\n {%- endif %}\n {%- if msg['tool_calls'] is defined and msg['tool_calls'] is not none %}\n {%- set msg = {'role': msg['role'], 'content': new_content, 'tool_calls': msg['tool_calls']} %}\n {%- else %}\n {%- set msg = {'role': msg['role'], 'content': new_content} %}\n {%- endif %}\n {%- endif %}\n {%- if msg['content'] is string %}\n {%- set ns_c.text_parts = ns_c.text_parts + [msg['content']] %}\n {%- elif msg['content'] is not none %}\n {%- for block in msg['content'] %}\n {%- if block['type'] == 'text' %}\n {%- set ns_c.text_parts = ns_c.text_parts + [block['text']] %}\n {%- else %}\n {%- if ns_c.text_parts | length > 0 %}\n {%- set ns_c.chunks = ns_c.chunks + [{'type': 'text', 'text': ns_c.text_parts | join('\\n\\n')}] %}\n {%- set ns_c.text_parts = [] %}\n {%- endif %}\n {%- set ns_c.chunks = ns_c.chunks + [block] %}\n {%- set ns_c.has_non_text = true %}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- if msg['tool_calls'] is defined and msg['tool_calls'] is not none %}\n {%- set ns_c.tool_calls = ns_c.tool_calls + msg['tool_calls'] | list %}\n {%- endif %}\n {%- endfor %}\n {%- if ns_c.has_non_text %}\n {%- if ns_c.text_parts | length > 0 %}\n {%- set ns_c.chunks = ns_c.chunks + [{'type': 'text', 'text': ns_c.text_parts | join('\\n\\n')}] %}\n {%- endif %}\n {%- set merged_content = ns_c.chunks %}\n {%- else %}\n {%- set merged_content = ns_c.text_parts | join('\\n\\n') %}\n {%- endif %}\n {%- if ns_c.tool_calls | length > 0 %}\n {%- set ns_agg.messages = ns_agg.messages + [{'role': ns_agg.current_role, 'content': merged_content, 'tool_calls': ns_c.tool_calls}] %}\n {%- else %}\n {%- set ns_agg.messages = ns_agg.messages + [{'role': ns_agg.current_role, 'content': merged_content}] %}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] != '__sentinel__' %}\n {%- set ns_agg.current_group = [message] %}\n {%- set ns_agg.current_role = message['role'] %}\n {%- endif %}\n {%- else %}\n {%- set ns_agg.current_group = ns_agg.current_group + [message] %}\n {%- endif %}\n{%- endfor %}\n{%- set loop_messages = ns_agg.messages %}\n\n{#- Validates message ordering. #}\n{%- set ns = namespace(available_tools_and_settings_emitted=false) %}\n{%- if loop_messages | length > 0 and loop_messages[0]['role'] != 'user' and loop_messages[0]['role'] != 'system' %}\n {{- raise_exception('Conversation must start with a user or system message, got ' + loop_messages[0]['role'] + '.') }}\n{%- endif %}\n{%- set ns_order = namespace(previous_role=none) %}\n{%- for message in loop_messages %}\n {%- set current_role = message['role'] %}\n {%- if ns_order.previous_role is not none %}\n {%- if ns_order.previous_role == 'system' %}\n {%- if current_role != 'user' and current_role != 'assistant' and current_role != 'system' %}\n {{- raise_exception('Unexpected role \\'' + current_role + '\\' after role \\'' + ns_order.previous_role + '\\'') }}\n {%- endif %}\n {%- elif ns_order.previous_role == 'user' %}\n {%- if current_role != 'assistant' and current_role != 'system' and current_role != 'user' %}\n {{- raise_exception('Unexpected role \\'' + current_role + '\\' after role \\'' + ns_order.previous_role + '\\'') }}\n {%- endif %}\n {%- elif ns_order.previous_role == 'assistant' %}\n {%- if current_role != 'assistant' and current_role != 'user' and current_role != 'tool' %}\n {{- raise_exception('Unexpected role \\'' + current_role + '\\' after role \\'' + ns_order.previous_role + '\\'') }}\n {%- endif %}\n {%- elif ns_order.previous_role == 'tool' %}\n {%- if current_role != 'assistant' and current_role != 'tool' and current_role != 'user' %}\n {{- raise_exception('Unexpected role \\'' + current_role + '\\' after role \\''