Ollama 윈도우 설치 파일 다운로드
https://ollama.com/ 접속 -> Download for Windows를 클릭 -> OllamaSetup.exe를 다운로드
Phi-3-mini-4K-Instruct GGUF 모델 파일 다운로드
# D:\qwen\Modelfile
FROM "D:\pwen\qwen2.5-coder-7b-instruct-q4_k_m.gguf""
# Qwen 2.5 공식 ChatML 프롬프트 템플릿 및 Tool Calling 대응 설정
TEMPLATE """{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{- end }}
{{- range .Messages }}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{- else if eq .Role "assistant" }}<|im_start|>assistant
{{ .Content }}<|im_end|>
{{- end }}
{{- end }}<|im_start|>assistant
"""
# 모델이 스스로 멈춰야 할 특수 토큰 지정
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
# 컨텍스트 크기를 4096에서 32,768 토큰으로 확장
PARAMETER num_ctx 32768
cd D:\qwen
ollama create qwen-coder -f ./Modelfile
ollama run qwen-coder
node.js 설치되었다는 기준으로 진행
npm install -g @anthropic-ai/claude-code
:: Claude 설정 파일이 기존 외부 로그인 정보와 충돌하지 않도록 가상 경로 지정
set CLAUDE_CONFIG_DIR=C:\qwen\.claude-ollama
:: API Key는 비워두거나 더미값 세팅
set ANTHROPIC_API_KEY=local-bypass
:: Ollama의 Anthropic 호환 규격 통과를 위한 Bearer 토큰 강제 지정 (중요)
set ANTHROPIC_AUTH_TOKEN=ollama
:: 로컬 Ollama 엔드포인트 지정
set ANTHROPIC_BASE_URL=http://localhost:11434
claude --mode qwen-coder