Ollama 사용법

AI 2024. 1. 11. 00:57

    - 글 생성 AI 모델들을 간단하게 명령어로 설치하고 구동시켜주는 프로그램

 

Ollama
https://ollama.ai
https://github.com/jmorganca/ollama - 30.4k

- 매뉴얼
https://github.com/jmorganca/ollama/blob/main/docs/README.md


* Ollama (서버) 설치(리눅스)
- 윈도우에서는 wsl 사용
- 업그레이드도 같은 명령
$ curl https://ollama.ai/install.sh | sh


* Ollama (서버) 시작
$ ollama serve


* 사용가능한 LLM 모델 리스트, 검색
https://ollama.ai/library


* mistral 모델 실행 방법
https://ollama.ai/library/mistral
- 7B (Mistral AI)

$ ollama run mistral
- 바로 AI와 채팅 가능

- 여러 줄은 파이썬 문자열 문법과 동일 
""" 문자열
문자열2
"""

- API 모드 
curl -X POST http://localhost:11434/api/generate -d '{
  "model": "mistral",
  "prompt":"Here is a story about llamas eating grass"
 }'

- chat 모드
curl http://localhost:11434/api/chat -d '{
  "model": "mistral",
  "messages": [
    { "role": "user", "content": "why is the sky blue?" }
  ]
}'


* mixtral
https://ollama.ai/library/mixtral
$ ollama run mixtral

Mixtral-8x7B
: Llama 2 70B 보다 성능 좋음
: 48G RAM 필요



* microsoft Phi-2
https://ollama.ai/library/phi
$ollama run phi



//-------------------------------------
- 실행 포트 변경 방법
$ export OLLAMA_HOST="127.0.0.1:11435"
$ ollama serve

반응형

'AI' 카테고리의 다른 글

AI LLM Benchmark Rank 순위 Leaderboard  (0) 2024.01.09
google cloud vertex ai API로 text 생성 Gemini Pro 사용법  (0) 2023.12.14
철학적인 질문  (0) 2023.11.08
메타 LLaMA 2 사용법  (0) 2023.11.08
MS 오픈 소스 LLM, Phi 1.5 사용법  (0) 2023.11.08
Posted by codens


반응형