https://medium.com/stackademic/the-synergy-of-spring-ai-and-ollama-transforming-local-ai-interactions-with-llms-4e5bcc1a1c95

 

The Synergy of Spring AI and Ollama: Transforming Local AI Interactions with LLMs

Java and Spring leads the majority of the development community even in these modern times and python is predominant weapon when coming to…

blog.stackademic.com

위 미디엄 아티클을 보며 실습을 해봤다.

아티클과 다르게 구성한점

  • llama2 -> llama3
  • 애플리케이션 실행 시 yaml 파일의 model 옵션이 적용이 안됨
    • OllamaEmbeddingsGenerator 클래스에 mistral로 하드코딩 되어 있었음
    • OllamaChatGenerator 의 경우 하드코딩되어 있진 않았으나 yaml 설정이 적용안되어 코드 삽입
    public Map generate(String message) {
        return Map.of("generation", 
                this.ollamaChatClient.withDefaultOptions(OllamaOptions.create().withModel("llama3")).call(message));
    }

 

 

 

아래와 같은 단계로 진행하였다. 

1. Ollama 사이트에서 다운로드 및 설치 : https://ollama.com/download

2. Ollama 를 이용하여 llama3 model pull

ollama pull llama3

3. https://start.spring.io/ 를 이용하여 spring ai 프로젝트 생성

4. 애플리케이션 실행 

5. 테스트 

 

 

https://medium.com/@tpbabparn/in-house-llm-application-by-spring-ai-ollama-91c48e2d2d38

 

In-house LLM-application by Spring AI + Ollama

My pet project for learning Spring AI + Ollama

tpbabparn.medium.com

 

아티클 내용을 다 보진 못했지만 Spring AI를 이용해서 인하우스 LLM을 구축해보는 학습용으로 좋을 것 같다. 

킵해 놓고 주말에 실습을 해봐야 겠다. 

+ Recent posts