{"id":29253499,"url":"https://github.com/hordiales/llm-rag-assistant-streamlit","last_synced_at":"2025-07-04T02:06:37.629Z","repository":{"id":302178450,"uuid":"1011491652","full_name":"hordiales/llm-rag-assistant-streamlit","owner":"hordiales","description":"Local chatbot (no API) designed to answer questions in Spanish using your own Q\u0026A dataset. Simple UI using streamlit","archived":false,"fork":false,"pushed_at":"2025-07-01T01:29:19.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T01:36:54.832Z","etag":null,"topics":["llm","prototype","rag-chatbot","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hordiales.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-30T22:53:15.000Z","updated_at":"2025-07-01T01:29:21.000Z","dependencies_parsed_at":"2025-07-01T01:36:57.081Z","dependency_job_id":"b200f9cb-f2e9-438e-af53-07c12800d184","html_url":"https://github.com/hordiales/llm-rag-assistant-streamlit","commit_stats":null,"previous_names":["hordiales/llm-rag-assistant-streamlit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hordiales/llm-rag-assistant-streamlit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hordiales%2Fllm-rag-assistant-streamlit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hordiales%2Fllm-rag-assistant-streamlit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hordiales%2Fllm-rag-assistant-streamlit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hordiales%2Fllm-rag-assistant-streamlit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hordiales","download_url":"https://codeload.github.com/hordiales/llm-rag-assistant-streamlit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hordiales%2Fllm-rag-assistant-streamlit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263432198,"owners_count":23465571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","prototype","rag-chatbot","streamlit"],"created_at":"2025-07-04T02:02:59.382Z","updated_at":"2025-07-04T02:06:37.611Z","avatar_url":"https://github.com/hordiales.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Summary\n===============================\n\nllm-rag-assistant is a fully local, retrieval-augmented chatbot powered by llama-cpp-python, designed to answer questions in Spanish using your own Q\u0026A dataset. It uses semantic search via FAISS + multilingual sentence-transformers to retrieve relevant answers, and combines it with a local instruction-tuned LLM (e.g., Mistral-7B-Instruct in GGUF format) for contextual response generation.\n\n## 🚀 Features\n-\t🔍 Semantic Search with multilingual embeddings (sentence-transformers)\n-\t🧠 Local LLM inference without a GPU using optimized GGUF models + llama-cpp-python\n-\t💻 Runs on standard laptops and desktops — no CUDA, no GPU, no special hardware required\n-\t🔒 No API keys, no cloud dependency — fully private and offline\n-\t🌐 Instant web interface with Streamlit\n-\t🐳 Docker \u0026 Docker Compose ready for easy deployment\n-\t🗂️ Plug-and-play with any Q\u0026A dataset in JSON format\n\nRAG Local - Instructions\n===============================\n\nThis package lets you run a console chatbot with semantic retrieval (RAG) on your machine, with no need for a GPU or external connection.\n\nThis version works in the console. For a UI version, see the streamlit version.\n\nRequirements:\n-------------\n1. Python 3.9+\n2. Install dependencies:\n   pip install llama-cpp-python faiss-cpu sentence-transformers\n\nTested with python-3.13.5, specific versions in environment.yml\n    # On macOS, if build fails try\n    conda install -c conda-forge llama-cpp-python\n    pip install faiss-cpu sentence-transformers\n\n3. Download the GGUF model:\n\nFor example\n```bash\n   wget https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf -O mistral-7b-instruct.Q4_K_M.gguf\n```\n\nOpen source model, apache 2.0 license\n  https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1\n\n4. Build a question and answer dataset\n\nImportant: Save it in the file qa_dataset.json\n\nIt should have the following structure (example)\n```json\n[\n  {\n    \"pregunta\": \"¿Cuál es el horario de atención?\",\n    \"respuesta\": \"Nuestro horario de atención es de lunes a viernes de 9:00 a 18:00 horas y sábados de 9:00 a 14:00.\"\n  },\n  {\n    \"pregunta\": \"¿Cómo puedo contactar con soporte técnico?\",\n    \"respuesta\": \"Puede contactar con soporte técnico a través del email soporte@empresa.com, llamando al 900-123-456 o mediante el chat en vivo de nuestra web.\"\n  },\n  ...\n]\n```\n\n5. Create the config.yaml file for RAG System configuration\n\nFor example\n\n```yaml\nmodels:\n  embeddings:\n    model_name: \"sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2\"\n  generation:\n    llama_cpp_model_path: \"models/mistral-7b-instruct.Q4_K_M.gguf\"\n    max_tokens: 256\n```\n\n*Note:* To work with this type of Q\u0026A dataset, you need an instruction-tuned model.\n\nTODO:\n-----\n* Add temperature configuration\n\nIncluded files:\n-------------------\n- prepare_embeddings.py → generates scibot_index.faiss and qa.json from your dataset\n- app.py  → runs the streamlit app\n- qa_dataset.json → your knowledge base\n\nSteps:\n------\n\nUse docker compose (see below) or run manually:\n\n1. Run: python prepare_embeddings.py\n2. Run: streamlit run app.py\n3. Chat with your knowledge base using a Spanish bot :)\n\nRequirements:\n-----------\n- 8GB RAM minimum (16GB recommended)\n- ~5GB of space for the models\n\n\n# Build and run with docker compose\n\n```bash\ndocker-compose build\n\ndocker-compose up -d\n\ndocker-compose down\n\ndocker-compose logs -f\n```\n\n# Access to aplication \n\nOpen your browser at: http://localhost:8501\n\n## 🐳 Extra docker commands\n\n```bash\n\n# Rebuild from scratch\ndocker-compose build --no-cachedocker-compose build --no-cache\n\n# Execute inside the container\ndocker-compose exec rag-app python compute_embeddings.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhordiales%2Fllm-rag-assistant-streamlit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhordiales%2Fllm-rag-assistant-streamlit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhordiales%2Fllm-rag-assistant-streamlit/lists"}