티스토리

이것저것이반네
검색하기

블로그 홈

이것저것이반네

ivans-story.tistory.com/m

하나도 모르는 HANA부터 조금아는 DB와 해야하는 WEB개발 지금 핫한 LLM/LangChain까지

구독자
4
방명록 방문하기
공지 HANA DB 알아보기 모두보기

주요 글 목록

  • DeepSeek 저는 LLM관련 개발자나 전문가는 아님IT업에 종사하는 개발자이자 엔지니어이자 데이터 분석가로써 LLM을 활용하고자 여기저기 기웃거림따라서 잘못된 내용이 있을 수 있음 이 글은 아들에게 전달해주기 위해서 간략하게 정리한 내용으로 상세한 내용 보다는 대략적인 개념 위주로 정리함   아들아DeepSeek에 대해서 간단하게 핵심만 알아본 내용이라고 생각하면 될 것 같다.어제 Local에 다운 받은 모델이고 ~ 사이에 추론 과정을 보여주며 결과를 만드는 것을 보고 어떻게 느꼈는지 모르겠지만 스케일링의 법칙 아래서 거대 조직에서만 가능할 거라 생각했던 모델을 만드는 것이 이렇게 여러가지 기법을 가지고 그 한계를 극복하는 과정을 걷고 있는 중국이 무섭기도 하지만 새로운 가능성을 만들어 주고 있다고 생각한다. 내.. 공감수 3 댓글수 0 2025. 2. 4.
  • Try it 목표 :- LLM 관련 Chatbot 구동- Local LLM 및 Vector store - 모든 환경은 docker container   단계 1. Install Linux(Ububtu) on Windows windows + wsl - linux env on windows - ubuntu   * (Searching keyword) windoes wsl ubuntu  2. connect to Linux ssh and telnet client - ex) putty, mobaxterm*   * (Searching keyword) putty or mobaxterm 3. Install Docker install docker - install docker    * (Searching keyword) install.. 공감수 2 댓글수 0 2025. 1. 17.
  • (Docker) ollama + chroma로 RAG 구성 RAG 구성 with docker 환경 정의환경 변수>>> CHROMA_IP = '***'>>> CHROMA_PORT = 8000>>> OLLAMA_IP = '***'>>> OLLAMA_PORT = 11434>>> LLM_MODEL = 'llama3.1'ollama / chromadb 모두 docker로 구성됨  Vector store 구성 및 Document embeddingChromadb client 정의>>> import chromadb>>> clientChroma = chromadb.HttpClient(host=CHROMA_IP, port=CHROMA_PORT)>>> print(clientChroma.list_collections())chromadb 접속을 위한 client 정의list_colle.. 공감수 1 댓글수 0 2024. 8. 14.
  • LangChain - LLM Parameter from langchain_openai import ChatOpenAI from langchain_core.prompts import ChatPromptTemplate prompt = ChatPromptTemplate.from_messages([ ("system", "This system can response about IT system"), ("user", "{user_input}"), ]) params = { "temperature" : 0.3, "max_tokens" : 100, "frequency_penalty" : 0.5, "presence_penalty" : 0.5, "stop" : ["\n"] } model = ChatOpenAI(max_tokens=500) query = 'Pacemake.. 공감수 0 댓글수 0 2024. 4. 5.
  • LangChain - 2.6 Retrievers 참조 : https://python.langchain.com/docs/modules/data_connection/retrievers/ Retrievers | 🦜️🔗 Langchain A retriever is an interface that returns documents given an unstructured query. It is more general than a vector store. python.langchain.com Retrievers 구조화 되지 않은 쿼리가 제공되면 문서를 반환하는 Interface로 문서 저장 없이 반환하기만 함 Name Index Type Uses an LLM When to use Description Vectorstore Vectorstore No 쉽게 사용 가능 .. 공감수 0 댓글수 0 2024. 4. 3.
  • LangChain - 2.5 Vector stores GetStarted 참조 : https://python.langchain.com/docs/modules/data_connection/vectorstores/ Vector stores | 🦜️🔗 Langchain Head to Integrations for documentation on built-in integrations with 3rd-party vector stores. python.langchain.com Vector stores Embedding 된 vector 값을 저장하는 DB 여기서는 Chroma 기준으로 테스트 진행함 from langchain_community.document_loaders import TextLoader from langchain_openai import OpenAIEmbeddings f.. 공감수 0 댓글수 0 2024. 4. 2.
  • LangChain - 2.4 Text embedding models 참조 : https://python.langchain.com/docs/modules/data_connection/text_embedding/ Text embedding models | 🦜️🔗 Langchain Head to Integrations for documentation on built-in integrations with text embedding model providers. python.langchain.com Text embedding models Embedding class = text embedding models와 i/f를 위하여 design되었으며 다양한 embedding model 제공됨 (OpenAI, Hugging Face, Cohere 등) Embedding은 Text 조각의.. 공감수 0 댓글수 0 2024. 4. 2.
  • LangChain - 2.3 Text Splitter 참조 : https://python.langchain.com/docs/modules/data_connection/document_transformers/ Text Splitters | 🦜️🔗 Langchain Once you've loaded documents, you'll often want to transform them to better suit your application. The simplest example python.langchain.com Text Splitter 다음과 같이 동작 아주 작은 chunk 단위 (문장)로 나눔 특정 크기에 도달할때 까지 작은 단위를 큰 단위의 chunk 단위로 결합 해당 크기에 도달하면 해당 chunk를 고유한 텍스트 조작으로 만든 다음 약간 겹치는 새로운.. 공감수 0 댓글수 0 2024. 4. 2.
  • LangChain - 2.2 Document loaders 참조 : https://python.langchain.com/docs/modules/data_connection/document_loaders/csv CSV | 🦜️🔗 Langchain A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. python.langchain.com Document loaders Source에서 document를 load Simplest loader from langcha.. 공감수 0 댓글수 0 2024. 4. 1.
  • LangChain - 2.1 Retrieval concept 참조 : https://python.langchain.com/docs/modules/data_connection/ Retrieval | 🦜️🔗 Langchain Many LLM applications require user-specific data that is not part of the model's training set. python.langchain.com Retrieval LLM 애플리케이션에서 user-specific data를 필요로함 -> 이를 위해 RAG (Retrieval Augmented Generation) 제공 Concept Item Desc Etc. Document loaders 많은 다른 source로부터 document를 load함 Text Splitting Retrieva.. 공감수 0 댓글수 1 2024. 3. 29.
  • LangChain 1.5.1 Types of output parser 침조 : https://python.langchain.com/docs/modules/model_io/output_parsers/ Output Parsers | 🦜️🔗 Langchain Output parsers are responsible for taking the output of an LLM and transforming it to a more suitable format. This is very useful when you are using LLMs to generate any form of structured data. python.langchain.com CSV parser from langchain.output_parsers import CommaSeparatedListOutputParser .. 공감수 0 댓글수 0 2024. 3. 29.
  • LangChain - 1.4.1 Chat Models QuickStart 참조 : https://python.langchain.com/docs/modules/model_io/chat/quick_start Quick Start | 🦜️🔗 Langchain quick-start} python.langchain.com Chat Models Language model의 변형으로 내부적으로는 language model을 사용하지만 interface가 다름 (Chat messge가 interface로 사용됨) Setup 사용하고자 하는 LLM의 python package 설치하고 API 접근을 위한 Key를 설정하면 끝! Step Desc Etc. 1. Install Python package pip install langchain-openai 2. Setup API Key OS> ex.. 공감수 0 댓글수 0 2024. 3. 28.
  • LangChain - 1.3.3 Caching & Streaming & Token usage 참조 : https://python.langchain.com/docs/modules/model_io/llms/llm_caching Caching | 🦜️🔗 Langchain LangChain provides an optional caching layer for LLMs. This is useful python.langchain.com Caching API call 횟수를 줄이기 위해서 caching 사용 Method Code Etc. (Prepare) llm = OpenAI(model_name="gpt-3.5-turbo-instruct", n=2, best_of=2) InMemoryCache set_llm_cache(InMemoryCache()) SQLiteCache set_llm_cache(SQLite.. 공감수 0 댓글수 0 2024. 3. 28.
  • LangChain - 1.3.1 LLM QuickStart 참조 : https://python.langchain.com/docs/modules/model_io/llms/quick_start Quick Start | 🦜️🔗 Langchain quick-start} python.langchain.com LLM 다양한 LLM providers 존재 (OpenAI, Cohere, Hugging Face 등) Setup 사용하고자 하는 LLM의 python package 설치하고 API 접근을 위한 Key를 설정하면 끝! Step Desc Etc. 1. Install Python package pip install openai 2. Setup API Key OS> export OPEN_API_KEY="...' or In program> os.environ["OPENAI_.. 공감수 0 댓글수 0 2024. 3. 28.
  • LangChain - 1.2.5 MessagePromptTemplate 참조 : https://python.langchain.com/docs/modules/model_io/prompts/message_prompts Types of `MessagePromptTemplate` | 🦜️🔗 Langchain LangChain provides different types of MessagePromptTemplate. The most python.langchain.com MessagePromptTemplate 다양한 유형의 MessagePromptTemplate 제공 ChatMessagePromptTemplate But, chat model이 임의의 역할로 chat meaages 가져오기를 지원하는 경우 사용자가 role 지정 가능 from langchain.prompts import.. 공감수 0 댓글수 0 2024. 3. 28.
  • LangChain - 1.2.4 Few-shot prompt template 참조 : https://python.langchain.com/docs/modules/model_io/prompts/few_shot_examples Few-shot prompt templates | 🦜️🔗 Langchain In this tutorial, we’ll learn how to create a prompt template that uses python.langchain.com 참조 : https://python.langchain.com/docs/modules/model_io/prompts/few_shot_examples_chat Few-shot examples for chat models | 🦜️🔗 Langchain This notebook covers how to use few-shot exa.. 공감수 0 댓글수 0 2024. 3. 28.
  • LangChain - 1.2.2 Example Selector 참조 : https://python.langchain.com/docs/modules/model_io/prompts/example_selector_types/ Example Selector Types | 🦜️🔗 Langchain | Name | Description | python.langchain.com Example Selector Types LLM에 Prompt를 input으로 전달할 떄 적절한 Example이 함께 전달되면 결과의 정확도가 높아지므로 적절한 Example을 선정하는 것이 중요 Name Description example_selector dynamic_prompt Length Length 기준 LengthBasedExampleSelector( examples = ***, example.. 공감수 0 댓글수 0 2024. 3. 28.
  • LangChain - 1.2.1 PromptTemplate 참조 : https://python.langchain.com/docs/modules/model_io/prompts/quick_start Quick Start | 🦜️🔗 Langchain quick-start} python.langchain.com https://python.langchain.com/docs/modules/model_io/prompts/composition Composition | 🦜️🔗 Langchain LangChain provides a user friendly interface for composing different python.langchain.com Prompt Template predefined recipes for generating prompts for language .. 공감수 0 댓글수 0 2024. 3. 27.
  • LangChain - 1.1 Model I/O Concept 참조 : https://python.langchain.com/docs/modules/model_io/concepts Concepts | 🦜️🔗 Langchain The core element of any language model application is...the model. LangChain gives you the building blocks to interface with any language model. Everything in this section is about making it easier to work with models. This largely involves a clear interfa python.langchain.com Concepts Group Item Desc Other.. 공감수 0 댓글수 0 2024. 3. 27.
  • LangChain 참조 : https://python.langchain.com/docs/modules/ Modules | 🦜️🔗 Langchain LangChain provides standard, extendable interfaces and external integrations for the following main modules: python.langchain.com Modules 구분 Modules Components Item-1 Item-2 Link Main 1. Model I/O 1.1 Concepts 1.1 1.2 Prompts 1.2.1 Template Composition PromptTemplate ChatPromptTemplate 1.2.1 String prompt composition Chat pr.. 공감수 0 댓글수 0 2024. 3. 27.
  • [Langchain] Prompt 튜닝 출처 : https://bcho.tistory.com/1414 Langchain을 이용한 LLM 애플리케이션 개발 #8 - 프롬프트 예제 선택기 프롬프트 예제 선택기를 이용한 동적으로 프롬프트 삽입하기 조대협 (http://bcho.tistory.com) 프롬프트를 통한 정확도를 높이기 위한 기법인 프롬프트 튜닝에서 가장 큰 효과를 볼 수 있는 방식이 프 bcho.tistory.com Prompt 튜닝 Prompt 통해 정확도를 높이기 위한 방법 >> 질문과 답변에 예제를 추가하는 방식 기본원리는 여러개의 예제를 저장해 놓고, 질문에 따라서 가장 유사한 예제를 선택하는 방식 (Example Selector 제공) Length 기반 전체 Prompt의 길이 기반 ########################.. 공감수 1 댓글수 1 2024. 3. 5.
  • [Software Architect] GRASP GRASP란 General Responsibility Assignment Software Patterns Craig Larman's 9 principles Object-Oriented 디자인의 핵심은 각 객체에 책임을 부여하는 것 책임을 부여하는 원칙을 말하고 있는 패턴 1. Information Expert 책임을 수행할 수 있는 데이터를 가지고 있는 객체에 책임을 부여하는 것 (객체는 데이터와 처리 로직이 함께 묶이는 것) 한 가지 객체에 너무 많은 Responsibility를 할당하는 것은 복잡도를 향상시켜 유지보수에 좋지 않다. Responsibility를 할당할 때에는 설계 모델에서 적합한 클래스를 탐색, 없을 경우 도메인 모델에서 적절한 도메인에서 찾아 할당한다. 정보은닉을 통해서 자신의 데이.. 공감수 0 댓글수 0 2022. 5. 13.
  • [Software Architecture] SOLID Reference : https://dev-momo.tistory.com/entry/SOLID-%EC%9B%90%EC%B9%99 SOLID 원칙 프로그래밍 설계를 하다보면 객체지향 5대원칙 또는 SOLID 원칙이란 단어를 들어본 적이 있을 것이다. 당시에 구글링을 하여 찾아보았지만 프로그래밍 내공이 부족하여 잘 이해가 되지 않았다. dev-momo.tistory.com 객체 지향 5대 원칙이란 SRP(단일 책임 원칙), OCP(개방-폐쇄 원칙), LSP(리스코프 치환 원칙), DIP(의존 역전 원칙), ISP(인터페이스 분리 원칙)을 말하며, 앞자를 따서 SOILD 원칙이라고 부른다. 프로그래머가 시간이 지나도 유지 보수와 확장이 쉬운 소프트웨어를 만드는데 이 원칙들을 적용할 수 있다. 1. Single.. 공감수 0 댓글수 0 2022. 5. 13.
  • [Software Architecture] Pattern 에 대해서 패턴 구현, 설계하는 도구 (업계에서 통용되는 언어) 패턴은 Interface + Concrete class 형태로 구성되어 있음 이런 패턴들이 여러가지가 있어 -> 생성시 사용되면 Factory pattern 등 여러개의 패턴이 뭉쳐서 움직인다 팀 내 의사 소통의 수단이 되기 위해선, 팀원들의 이해가 필요한다 패턴의 남용 리소스 제약이 심한 시스템에 유연성 추가하기? -> 성능상에 문제가 발생하는 경우 패턴의 Side-effect가 굉장히 크기 때문에 이에 대한 부분을 확인을 해야 함 추천 알기쉬운 디자인 패턴 Head First Design Pattern Java 언어로 배우는 디자인 패턴 입문 POSA 1 거대한 구조를 잡을 때 쓰는 패턴 Layer, Pipe & Filter, Broker, Mas.. 공감수 0 댓글수 0 2022. 4. 6.
  • [Software Architecture] 아키텍처 설계 품질속성 이해 SW아키텍처가 만족시키고자 하는 품질 요구사항 시스템 품질속성 비즈니스 품질속성 시장적시성 (Time to Market) - 빠르게 개발하는 것 비용과 이익 (Cost and benefit) 시스템의 프로젝트 생명주기 - 정책적으로 SW를 어떻게 할 것인지 - 요금정책 (기능추가, Update 추가할때마다 사용료 받을지) 목표시장 (Targeted market) 신규발매일정 노후 시스템과의 통합 아키텍처 품질속성 실무에서의 핵심 비지니스 적인 속성을 얼마나 만족시켜 주느냐? 비기능적 품질속성, 비기능적 요구사항으로 도출됨 -> 여기에 집중 해야 함 개발업무에서 중요한 부분 시스템 품질 속성 QA 시나리오 (품질속성 시나리오) 요구사항을 명세 (개발자가 이해하기 쉽게 쓰는 것 -> 의사소통 .. 공감수 0 댓글수 0 2022. 4. 5.
  • [Software Architecture] Requirement Engineering - 2 Use Case Analysis 개요 A means for capturing the desired behavior for the system under development Communication 방법 모든 요구사항이 도출되었는지 확인할 수 있는 방법 Benefit 이해하기/읽기 쉬움 Customer와 합의 이루는데 도움 구성 (Use Case = Use Case Diagram + Texture) Actor 같은 특성을 모아서 표현 (Sam, Ivan -> Student) 역할이 다르면 쪼개기도 함 시스템에 직접 interface 하는 개체가 Actor가 될 수 있음 - use the system - get information from this system - provide information to.. 공감수 0 댓글수 0 2022. 4. 1.
  • [Software Architecture] Requirement Engineering - 1 Requirement Engineering 개요 System services Constraints Requirement = 시스템 서비스(System service) + 제약사항 (Constraint) - System service = Functional requirements - Constraint = Non-Functional requirements RE process Development process에 따라서 빈도/시점 등은 달라질 수 있음 ex) - Waterfall : 초반에 가능한 많은 Requirement를 정의 - Incremental : 초반에 가능한 많은 Requirement 정의 후 개발은 쪼개서 진행 (Release 1,2,3 등) - Spiral : risk analysis, r.. 공감수 0 댓글수 0 2022. 3. 31.
  • [Software Architecture] SA Framework 개요 Software Architecture Framework - Based on IEEE 1471-2000, IEEE (2000) Viewpoint Models - ISO RM-ODP - ISO(1994) - Siemens Four View Model - Soni, D. et al (1995) - 4 + 1 View Model - Kruchten, P. (1997) - SEI View Model, Clements, P. et al. (2002b) IEEE 1471 Framework 아키텍처는 유연하고 확장성을 가져야 하며 이러한 아키텍처를 개발하기 위해서 아키텍처 프레임워크가 필요 중요성 - 관련된 용어와 개념을 통일 - 정해진 모델링 언어, 특정 방법론을 제시하지 않기 때문에 기술적 중립성을 가지고 .. 공감수 0 댓글수 0 2022. 3. 31.
  • [Software Architecture] Architecture Decisions 개요 시스템의 비기능적 특성에 영향을 준다 각 아키텍처 결정은 몇 가지 잠재적 솔루션이 존재 의사결정 결과에 대한 디자인 근거를 제공 - 아키텍처 결정에서 다루는 품질 속성 중 하나 이상을 참조하고 - 디자인 및 option 선택에 대한 "이유" 질문에 대한 답을 하므로써 디자인 근거를 제공함 아키텍처 결정은 SW 시스템 전체 또는 이러한 시스템의 핵심 구성 요오 중 하나 이상과 관련됨 Decision Management Step First Step : Decision Identification (결정 식별) 결정을 내리기 전에 결정의 필요성을 분명히 해야 함 Architectural Decision이 얼마나 긴급하고 얼마나 중요한가? 지금 만들어야 하나 아니면 구축중인 요구사항 및 시스템에 대한 정보가.. 공감수 0 댓글수 0 2022. 3. 29.
  • [Software Architecture] RUP RUP (Rational Unified Process) 개요 RUP - 객체지향 개발 방법론 (2003년 IBM에 합병) Use Case를 기반으로 사용자의 요구사항을 기본으로 반복적이고 점진적인 개발 프로세스를 통해 시스템을 개발하는 UP(Unified Process) 프로세스 기반으로 Rational에서 만든 SW 개발 프로세스 모델 객체지향 프로젝트 수행에 맞도록 개발된 UML 기반의 객체지향 개발 방법론 RUP 특징 통합된 프로세스 Grady Booch의 OOAD (디자인에 강함) - 객체지향 분석과 설계를 위한 방법론 James Rumbaugh의 OMT (분석에 강함) - UML은 모델링 언어/ OMT는 객체 모델링 기법의 약자 -> UML의 전신으로 간주 Ivar Jacobson의 OOSE 방.. 공감수 0 댓글수 0 2022. 3. 29.
    문의안내
    • 티스토리
    • 로그인
    • 고객센터

    티스토리는 카카오에서 사랑을 담아 만듭니다.

    © Kakao Corp.