2️⃣Customization

LlamaIndex 특성화 배치

LlamaIndex의 RAG 프로세스는 개발자가 전체 프로세스의 특성화 설정을 수행할 수 있도록 전면적인 배치 지원을 제공했습니다. 일반적으로 볼 수 있는 배치 화면은 다음과 같습니다.

  1. 사용자 지정 문서 청크

  2. 사용자 지정 벡터 스토리지

  3. 사용자 인덱싱 검색 지정

  4. LLM 지정

  5. 응답 모드 지정

  6. 스트리밍 응답 지정

circle-info

특성화 설정은 주로 LlamaIndex가 제공하는 ServiceContext를 통해 이루어집니다.

사용자 지정 문서 청크

from llama_index.core import ServiceContext
service_context = ServiceContext.from_defaults(chunk_size=500)

사용자 지정 벡터 스토리지

import chromadb
from llama_index.vector_stores.chroma import ChromaVectorStore
from llama_index.core import StorageContext

chroma_client = chromadb.PersistentClient()
chroma_collection = chroma_client.create_collection("quickstart")
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
storage_context = StorageContext.from_defaults(vector_store=vector_store)

사용자 지정 자동 검색

자동 검색 시 쿼리 엔진(쿼리 엔진)을 통해 검색 시 유사한 문구를 검색할 수 있습니다.

LLM 지정

응답 모드 지정

스트리밍 응답 지정


LlamaIndex: Customization

  1. Dataset 준비

  2. Chunk & LLM 지정

  3. VectorStore 지정

  4. Indexing 검색 지정

  5. 응답 및 스트리밍 지정

Setup Environments

Dataset¶

Chunk & LLM¶

VectorStore

Indexing Document

Respone & Streaming

Last updated