본문 바로가기

정리중

[Tip]Local LLM 설치 및 이용 방법(Ollama, LM Studio)

구글 딥마인드의 알파고와 이세돌 九단과의 세기의 대결이 우리에게 충격을 준 이래 
(얼마 되지 않았다고 생각했는데 2016년이었다니.. 벌써 10년이 되고 있군요!! ) 
2022년 선보인 OpenAI의 ChatGPT는 AI 그리고 LLM(Large Language Model) 서비스를 
우리의 눈앞에 현실로 가져다 주었습니다. 

 

그리고 ChatGPT에 이어 다양한 LLM은 앞다투어 그 성능을 향상시키고 있으며
그 속도 역시 점점 가속화되고 있는 듯 합니다. 

 

이러한 상황에 물론 다양한 우려들이 나타나고 있지만, 
한편으로는 실제 우리가 이용할 수 있는 영역도 점점 다양하고 넓어지고 있습니다. 

그 중 하나가 LangChain입니다. 

 

LangChain 역시 2022년 소개된 이래 LLM을 활용한 채팅봇, 지능형 검색, 질문답변, 요약 등의 다양한 영역에 활용되고 있습니다. 

LangChain은 LLM 응용에 대한 프레임워크로 볼 수 있으며, 크게 UI와 활용 LLM으로 구분할 수 있으며,
그래서 다양한 LLM 모델을 활용할 수 있습니다. 

※ LangCahin = UI(Prompt 입력) - Index(외부 문서, Vector DB, Text Split(Chunk), 검색증강(RAG)) - 기억 - LLM(활용 모델)  

(특히 검색증강(RAG, Retrieval-Augmented Generation)은 파운데이션 모델(FM)의 제한을 넘어 
 최신 정보, 신뢰 정보, 비즈니스 환경 적합한 검색 결과를 얻을 수 있는 장점이 있습니다) 

 

우선, LangCahin을 이용하기 위해서 LLM의 API을 이용하는 방법도 있지만.. 

Local에 LLM 서버를 설치하여 활용하는 방법도 있습니다.

(충분한 컴퓨팅 리소스가 필요하긴 합니다.. ㅠㅠ) 

 

1) Ollama

https://ollama.com/

 

Ollama

Get up and running with large language models.

ollama.com

OllamaOllama
OllamaOllama
OllamaOllama

 

OllamaOllamaOllama

 

Ollama

 

Ollama

 

OllamaOllama
OllamaOllamaOllama

 

※ ollama 사용.. 

  - 모델 설치 확인 > ollama list

  - 모델 실행 > ollama run llama3.2:latest (설치되어 있지 않으면 설치됨) 

  - 모델 설치 위치 C:\Users\%username%\.ollama\models (C:\사용자\%사용자명%\.ollama\models) 

    (모델 설치 위치 변경을 위해서는 OLLAMA_MODELS 변수를 추가하면 됩니다) 

 

 

2) LM Studio 

https://lmstudio.ai/

 

LM Studio - Discover, download, and run local LLMs

Run Llama, Gemma 3, DeepSeek locally on your computer.

lmstudio.ai

 

LM StudioLM Studio
LM StudioLM StudioLM Studio

 

LM StudioLM Studio

 

LM StudioLM StudioLM Studio

 

LM StudioLM Studio

 

LM StudioLM StudioLM Studio

 

LM StudioLM StudioLM Studio

 

 

 

참고) 

  https://www.langchain.com/ 

  https://www.ibm.com/think/topics/langchain

  https://aws.amazon.com/ko/what-is/retrieval-augmented-generation/

  https://www.elastic.co/kr/what-is/retrieval-augmented-generation

  Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks https://arxiv.org/abs/2005.11401

 

 

반응형