Trying to create a RAG with everything local. im stuck on using the embeddings

Im trying to create a RAG, i start by breaking down the document into chunks, send it to a localy hosted embedding model, get the vectors back, and then i get stuck with the FAISS part.
my problem is that all of what i find seems to want to connect to hugging face or something, and the langchain stuff seems to be geared towards doing that so i will get my embeddings from an external source or have to spend days re-running code until i get a model to download fully without telling me the hash doesnt match because it only tryed downloading 98.4% of it. why do that when i have a perfectly good server.
so please help me get on track, because ive been trying to find an answer for this for hours.
hears my proof of concept code

import requests
from langchain_community.document_loaders import PyPDFLoader
from langchain.chains import retrieval_qa, RetrievalQA
from langchain_community.vectorstores.faiss import FAISS
from langchain.text_splitter import RecursiveCharacterTextSplitter

lm_studio_endpoint = "http://127.0.0.1:1234"

def setup_qa_system(file_path):
    # Load and split PDF documents
    try:
        loader = PyPDFLoader(file_path)
        docs = loader.load_and_split()
    except Exception as e:
        print(f"Error loading PDF: {e}")
        return None

    # Split documents into smaller chunks
    text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=50)
    chunks = text_splitter.split_documents(docs)

    # Function to get embeddings
    def get_embeddings(texts):
        print(f"Getting embeddings for {len(texts)} texts.")  # Debug output
        try:
            response = requests.post(f"{lm_studio_endpoint}/v1/embeddings", json={
                "input": texts,
                'model': 'text-embedding-granite-embedding-278m-multilingual'
            })
            response.raise_for_status()
            embeddings_data = response.json().get('data')

            # Extract embeddings from the response
            embeddings = [item['embedding'] for item in embeddings_data]

            print(f"Received {len(embeddings)} embeddings.")  # Debug output
            return embeddings
        except requests.exceptions.RequestException as e:
            print(f"Error getting embeddings: {e}")
            return []

    texts = [chunk.page_content for chunk in chunks]  # Extract texts from chunks
    print(f"Number of chunks: {len(chunks)}")
    print(f"Number of texts being sent: {len(texts)}")

    embeddings = get_embeddings(texts)  # Get embeddings

    # Check if embeddings were retrieved successfully
    if not embeddings or len(embeddings) != len(chunks):
        print(f"Error: Number of embeddings ({len(embeddings)}) does not match number of chunks ({len(chunks)}). Exiting setup.")
        return None

    # Create a list of (text, embedding) tuples
    text_embeddings = list(zip(texts, embeddings))

    # Create the FAISS vector store using the list of tuples
    vector_store = FAISS.from_embeddings(text_embeddings, embeddings)# <<<------THIS IS WHERE IM GETTING STUCK

    retriever = vector_store.as_retriever()

    def query_local_model(question, context):
        try:
            response = requests.post(f"{lm_studio_endpoint}/v1/completions", json={
                "prompt": f"Question: {question}nContext: {context}nAnswer:",
                "max_tokens": 150
            })
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            print(f"Error querying LM Studio: {e}")
            return {}

    # Adjust the QA chain to use the local model query function
    qa_chain = RetrievalQA.from_chain_type(
        llm=query_local_model,
        retriever=retriever
    )
    return qa_chain

if __name__ == '__main__':
    qa_chain = setup_qa_system('Documents/OfMiceAndMen.pdf')

    if qa_chain:
        # Example query
        query = "What is the main theme of 'Of Mice and Men'?"
        relevant_chunks = qa_chain.retriever.retrieve(query)

        context = " ".join(chunk.text for chunk in relevant_chunks)  # Prepare context from retrieved chunks
        result = qa_chain.llm(query, context)  # Call the local model
        print(result)

”’

the output
”’

Number of chunks: 214
Number of texts being sent: 214
Getting embeddings for 214 texts.
Received 214 embeddings.
Traceback (most recent call last):
  File "MyProjectDirRagTestmain.py", line 83, in <module>
    qa_chain = setup_qa_system('Documents/OfMiceAndMen.pdf')
  File "MyProjectDirRagTestmain.py", line 59, in setup_qa_system
    vector_store = FAISS.from_texts(text_embeddings)
TypeError: FAISS.from_texts() missing 1 required positional argument: 'embedding'

”’
and a sample of the server log
”’

2024-12-27 13:13:47 [DEBUG] [INFO] [LlamaEmbeddingEngine] All parsed chunks succesfully embedded!
2024-12-27 13:13:47 [DEBUG] [INFO] [LlamaEmbeddingEngine] All parsed chunks succesfully embedded!
2024-12-27 13:13:47 [DEBUG] [INFO] [LlamaEmbeddingEngine] All parsed chunks succesfully embedded!
2024-12-27 13:13:47 [DEBUG] [INFO] [LlamaEmbeddingEngine] All parsed chunks succesfully embedded!
2024-12-27 13:13:47 [DEBUG] [INFO] [LlamaEmbeddingEngine] All parsed chunks succesfully embedded!
2024-12-27 13:13:47 [DEBUG] [INFO] [LlamaEmbeddingEngine] All parsed chunks succesfully embedded!
2024-12-27 13:13:47  [INFO] Returning embeddings (not shown in logs)

”’

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật