{"id":17487506,"url":"https://github.com/beacoder/llm","last_synced_at":"2025-04-10T16:32:42.652Z","repository":{"id":258362662,"uuid":"871615240","full_name":"beacoder/llm","owner":"beacoder","description":"A bunch of experiments using Large Language Models","archived":false,"fork":false,"pushed_at":"2025-04-09T17:29:02.000Z","size":12398,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T17:42:57.241Z","etag":null,"topics":["agentic-ai","graphrag","langchain","langgraph","llm","ollama","qwen2","rag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beacoder.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}},"created_at":"2024-10-12T13:07:05.000Z","updated_at":"2025-04-09T17:29:06.000Z","dependencies_parsed_at":"2024-10-18T17:06:44.273Z","dependency_job_id":null,"html_url":"https://github.com/beacoder/llm","commit_stats":null,"previous_names":["beacoder/llm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beacoder%2Fllm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beacoder%2Fllm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beacoder%2Fllm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beacoder%2Fllm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beacoder","download_url":"https://codeload.github.com/beacoder/llm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252696,"owners_count":21072701,"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":["agentic-ai","graphrag","langchain","langgraph","llm","ollama","qwen2","rag"],"created_at":"2024-10-19T03:04:51.659Z","updated_at":"2025-04-10T16:32:42.642Z","avatar_url":"https://github.com/beacoder.png","language":"Python","readme":"# A bunch of experiments with LLMs\n\n## Build RAG/TOOL application with local LLMs\n\n### Install and run Ollama:\n\n```bash\n# My GPU is \"NVIDIA GeForce RTX 4070 Laptop GPU with 8G VRAM\", so I downloaded 7B version models.\n\n~$ mkdir ~/workspace/ai/\n\n~/workspace/ai$ curl -fsSL https://ollama.com/install.sh | sh\n\n~/workspace/ai$ ollama pull mistral\n~/workspace/ai$ ollama pull qwen2.5\n~/workspace/ai$ ollama pull nomic-embed-text\n\n~/workspace/ai$ ./ollama/bin/run_ollama\n```\n\n### Run AgenticRAG to analyze and search for JinPingMei\n\n```bash\n# make sure your python3 version \u003e= 3.10.12\n\n~/workspace/ai$ python3 -m venv rag_env\n~/workspace/ai$ source rag_env/bin/activate\n~/workspace/ai$ pip install -r rag/requirements.txt\n\n~/workspace/ai$ python ./rag/bin/agentic_rag.py\n\n# NOTE: to be able to handle org file, you have to run \"pip install pypandoc-binary\"\n```\n\n### Run GraphRAG to analyze and search for JinPingMei\n\n```bash\n# make sure your python3 version \u003e= 3.10.12\n\n~/workspace/ai$ python3 -m venv graphrag_env\n~/workspace/ai$ source graphrag_env/bin/activate\n~/workspace/ai$ pip install -r graphrag/requirements.txt\n\n~/workspace/ai$ mkdir ~/workspace/ai/ragtest\n~/workspace/ai$ cp -rf graphrag/ragtest ~/workspace/ai/ragtest\n\n# apply changes in modified_graphrag to installed graphrag for mistral/qwen2.5 accordingly\n# NOTE: finetuned prompt has been provided, if you wanna do it yourself, run ./bin/prompt_tuning\n\n~/workspace/ai$ ./graphrag/bin/graphrag_index\n\n~/workspace/ai$ ./graphrag/bin/local_query \"这个章节中，西门庆有几个老婆，他们的关系如何?\"\n\n# NOTE: global_query is not working due to graphrag code broken\n```\n\n### Run AgenticTool to explore AI-Agent\n\n```bash\n# make sure your python3 version \u003e= 3.10.12\n\n~/workspace/ai$ python3 -m venv tool_env\n~/workspace/ai$ source tool_env/bin/activate\n~/workspace/ai$ pip install -r tool/requirements.txt\n\n# support both local_tools and docker_tools.\n# for local_tools, tools will be executed on your file system.\n# for docker_tools, tools will be executed on docker instance for each user (identified by ip)\n# note: for docker_tools to work, #1 install docker, #2 run \"docker pull python:3.10.12\"\n~/workspace/ai$ streamlit run ./tool/bin/agentic_tool.py\n```\n\n### Results\n\n```bash\n# The model used for these images is qwen2.5, as it's good at Chinese.\n\n# NOTE: The result shows AgenticRAG beats GraphRAG most of the time, strange...\n```\n\n![西门庆和潘金莲什么关系?](images/graphrag_sample1.png)\n![这个章节中，西门庆有几个老婆，他们的关系如何?](images/graphrag_sample2.png)\n![这本书主要讲的是什么故事?](images/graphrag_sample3.png)\n![langchain_rag_questions](images/langchain_rag_sample1.png)\n\n```bash\n# TOOL task:\n# 1.Create a minesweeper game using html,css,js in directory \"~/workspace/ai/minesweeper\"\n# 2.list all the content of these new files.\n```\n![agentic_tool_1.png](images/tool_1.png)\n![agentic_tool_2.png](images/tool_2.png)\n![agentic_tool_3.png](images/tool_3.png)\n![agentic_tool_4.png](images/tool_4.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeacoder%2Fllm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeacoder%2Fllm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeacoder%2Fllm/lists"}