{"id":19289689,"url":"https://github.com/yingding/llm-examples","last_synced_at":"2026-06-11T01:31:40.802Z","repository":{"id":192575871,"uuid":"686954402","full_name":"yingding/llm-examples","owner":"yingding","description":"this repository contains codes for loading and training open source llm models e.g. LlaMA2","archived":false,"fork":false,"pushed_at":"2024-02-02T10:13:06.000Z","size":642,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T17:35:34.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/yingding.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":"2023-09-04T09:51:40.000Z","updated_at":"2023-10-31T08:05:05.000Z","dependencies_parsed_at":"2023-09-05T03:08:01.861Z","dependency_job_id":"89686c5b-c7b2-4698-9316-1704c0e83176","html_url":"https://github.com/yingding/llm-examples","commit_stats":null,"previous_names":["yingding/llm-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yingding/llm-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yingding%2Fllm-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yingding%2Fllm-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yingding%2Fllm-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yingding%2Fllm-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yingding","download_url":"https://codeload.github.com/yingding/llm-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yingding%2Fllm-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34178819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T22:16:45.360Z","updated_at":"2026-06-11T01:31:40.787Z","avatar_url":"https://github.com/yingding.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\nThe llm-examples are moved to [applyllm](https://github.com/yingding/applyllm) repo, unter `llm-examples` folder, this repo is deprecated onwards 2.Feb.2024.\n\n# llm-examples\nthis repository contains codes for loading and training open source llm models e.g. LlaMA2\n\n## update the venv on local mac host\n```shell\npython3 -m pip install --upgrade pip\npython3 -m pip install --no-cache-dir -r ./setup/requirements310mac.txt\n```\n\n## Test the load dev package\n```shell\nVENV_NAME=\"llm3.10\"\nVENV_DIR=\"$HOME/VENV\"\nsource ${VENV_DIR}/${VENV_NAME}/bin/activate;\nmake clean \u0026\u0026 make build \u0026\u0026 make reload\n```\n\n## Publish the pypi package\n```shell\nVENV_NAME=\"llm3.10\"\nVENV_DIR=\"$HOME/VENV\"\nsource ${VENV_DIR}/${VENV_NAME}/bin/activate;\nmake clean \u0026\u0026 make build \u0026\u0026 make publish\n```\n* `$HOME/.pypirc` shall be availabe, see the section `deploy token` below to create `$HOME/.pypirc` file\n\n## Add a jupyter notebook kernel to VENV\n```shell\nVENV_NAME=\"llm3.10\"\nVENV_DIR=\"$HOME/VENV\"\nsource ${VENV_DIR}/${VENV_NAME}/bin/activate;\npython3 -m pip install --upgrade pip\npython3 -m pip install ipykernel\ndeactivate\n```\n\nWe need to reactivate the venv so that the ipython kernel is available after installation.\n```shell\nVENV_NAME=\"llm3.10\"\nVENV_DIR=\"$HOME/VENV\"\nsource ${VENV_DIR}/${VENV_NAME}/bin/activate;\n# ipython kernel install --user --name=shap3.10\npython3 -m ipykernel install --user --name=${VENV_NAME} --display-name ${VENV_NAME}\n```\nNote: \n* restart the vs code, to select the venv as jupyter notebook kernel\n\n\nReference:\n* https://ipython.readthedocs.io/en/stable/install/kernel_install.html\n* https://anbasile.github.io/posts/2017-06-25-jupyter-venv/\n\n## Remove ipykernel\n```shell\n# jupyter kernelspec uninstall -y \u003cVENV_NAME\u003e\njupyter kernelspec uninstall -y shap3.10\n```\n\n## Remove all package from venv\n```\npython3 -m pip freeze | xargs pip uninstall -y\npython3 -m pip list\n```\n\n## Sync AIMLflow\n```shell\naim_repo_path=./aimruns\nmlflow_uri=./mlruns\nmkdir ${aim_repo_path}\ncd ${aim_repo_path}\naim init\ncd ..\n# start a watch process\naimlflow sync --mlflow-tracking-uri=${mlflow_uri} --aim-repo=${aim_repo_path}\n# start a second terminal\naim up --repo=${aim_repo_path}\n```\n\n## Restart MLflow UI\nIf the default port 5000 is used\n```shell\nps -A | grep gunicorn\npkill -f gunicorn\nps -A | grep gunicorn\nmlflow ui\n# mlflow server --host 127.0.0.1 --port 8080\n```\n\nReference:\n* https://stackoverflow.com/questions/60531166/how-to-safely-shutdown-mlflow-ui/63141642#63141642\n\n\n# Relevant tech info\n\n* [LLM tech docs](./LLM.md)\n* mlflow https://mlflow.org/docs/latest/llms/langchain/guide/index.html\n* mlflow langchain flavour https://mlflow.org/docs/latest/llms/langchain/index.html\n\n# Create Gitlab Python Artifacts\n## Build\n```shell\npackage=\"./ApplyLlm\";\ncd $package;\npython3 -m build;\n```\n\nOutput\n```console\n* Creating venv isolated environment...\n* Installing packages in isolated environment... (setuptools\u003e=61.0)\n* Getting build dependencies for sdist...\nrunning egg_info\ncreating applyllm.egg-info\nwriting applyllm.egg-info/PKG-INFO\nwriting dependency_links to applyllm.egg-info/dependency_links.txt\nwriting top-level names to applyllm.egg-info/top_level.txt\nwriting manifest file 'applyllm.egg-info/SOURCES.txt'\nreading manifest file 'applyllm.egg-info/SOURCES.txt'\nwriting manifest file 'applyllm.egg-info/SOURCES.txt'\n* Building sdist...\nrunning sdist\nrunning egg_info\nwriting applyllm.egg-info/PKG-INFO\nwriting dependency_links to applyllm.egg-info/dependency_links.txt\nwriting top-level names to applyllm.egg-info/top_level.txt\nreading manifest file 'applyllm.egg-info/SOURCES.txt'\nwriting manifest file 'applyllm.egg-info/SOURCES.txt'\nwarning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md\n\nrunning check\ncreating applyllm-0.0.1\ncreating applyllm-0.0.1/applyllm\ncreating applyllm-0.0.1/applyllm.egg-info\ncopying files to applyllm-0.0.1...\ncopying pyproject.toml -\u003e applyllm-0.0.1\ncopying applyllm/__init__.py -\u003e applyllm-0.0.1/applyllm\ncopying applyllm/test.py -\u003e applyllm-0.0.1/applyllm\ncopying applyllm.egg-info/PKG-INFO -\u003e applyllm-0.0.1/applyllm.egg-info\ncopying applyllm.egg-info/SOURCES.txt -\u003e applyllm-0.0.1/applyllm.egg-info\ncopying applyllm.egg-info/dependency_links.txt -\u003e applyllm-0.0.1/applyllm.egg-info\ncopying applyllm.egg-info/top_level.txt -\u003e applyllm-0.0.1/applyllm.egg-info\ncopying applyllm.egg-info/SOURCES.txt -\u003e applyllm-0.0.1/applyllm.egg-info\nWriting applyllm-0.0.1/setup.cfg\nCreating tar archive\nremoving 'applyllm-0.0.1' (and everything under it)\n* Building wheel from sdist\n* Creating venv isolated environment...\n* Installing packages in isolated environment... (setuptools\u003e=61.0)\n* Getting build dependencies for wheel...\nrunning egg_info\nwriting applyllm.egg-info/PKG-INFO\nwriting dependency_links to applyllm.egg-info/dependency_links.txt\nwriting top-level names to applyllm.egg-info/top_level.txt\nreading manifest file 'applyllm.egg-info/SOURCES.txt'\nwriting manifest file 'applyllm.egg-info/SOURCES.txt'\n* Installing packages in isolated environment... (wheel)\n* Building wheel...\nrunning bdist_wheel\nrunning build\nrunning build_py\ncreating build\ncreating build/lib\ncreating build/lib/applyllm\ncopying applyllm/__init__.py -\u003e build/lib/applyllm\ncopying applyllm/test.py -\u003e build/lib/applyllm\nrunning egg_info\nwriting applyllm.egg-info/PKG-INFO\nwriting dependency_links to applyllm.egg-info/dependency_links.txt\nwriting top-level names to applyllm.egg-info/top_level.txt\nreading manifest file 'applyllm.egg-info/SOURCES.txt'\nwriting manifest file 'applyllm.egg-info/SOURCES.txt'\ninstalling to build/bdist.macosx-13-arm64/wheel\nrunning install\nrunning install_lib\ncreating build/bdist.macosx-13-arm64\ncreating build/bdist.macosx-13-arm64/wheel\ncreating build/bdist.macosx-13-arm64/wheel/applyllm\ncopying build/lib/applyllm/__init__.py -\u003e build/bdist.macosx-13-arm64/wheel/applyllm\ncopying build/lib/applyllm/test.py -\u003e build/bdist.macosx-13-arm64/wheel/applyllm\nrunning install_egg_info\nCopying applyllm.egg-info to build/bdist.macosx-13-arm64/wheel/applyllm-0.0.1-py3.10.egg-info\nrunning install_scripts\ncreating build/bdist.macosx-13-arm64/wheel/applyllm-0.0.1.dist-info/WHEEL\ncreating '/Users/yingding/VCS/github/ml/llm-examples/ApplyLlm/dist/.tmp-izj9j4uq/applyllm-0.0.1-py3-none-any.whl' and adding 'build/bdist.macosx-13-arm64/wheel' to it\nadding 'applyllm/__init__.py'\nadding 'applyllm/test.py'\nadding 'applyllm-0.0.1.dist-info/METADATA'\nadding 'applyllm-0.0.1.dist-info/WHEEL'\nadding 'applyllm-0.0.1.dist-info/top_level.txt'\nadding 'applyllm-0.0.1.dist-info/RECORD'\nremoving build/bdist.macosx-13-arm64/wheel\nSuccessfully built applyllm-0.0.1.tar.gz and applyllm-0.0.1-py3-none-any.whl\n```\n\nYou can found the `.whl` distribution package file\nin `$package` -\u003e `dist` folder\n\n## using deploy token\n* Create gitlab group deployment token https://docs.gitlab.com/ee/user/project/deploy_tokens/\n\nGroup -\u003e Settings -\u003e Repository -\u003e deploy tokens \n\nAdd the access credential in user home dir.\n`touch $HOME/.pypirc`\n\nPush to the project, \n`https://gitlab.example.com/api/v4/projects/\u003cproject_id\u003e/packages/pypi`\n\u003cproject_id\u003e in project -\u003e Settings -\u003e General -\u003e Naming, topics, avatar\nor \"group%2Fproject\" as URL-encoded path for \"group/project\"\n\n```\n[distutils]\nindex-servers =\n    gitlab-lrz\n\n[gitlab-lrz]\nrepository = https://gitlab.lrz.de/api/v4/projects/dzkj%2Fllm/packages/pypi\nusername = \u003cdeploy token username\u003e\npassword = \u003cdeploy token\u003e\n```\n* From gitlab group level https://docs.gitlab.com/ee/user/packages/pypi_repository/#install-from-the-group-level\n\n## Allow every one to pull from project\ngitlab project -\u003e Settings -\u003e General -\u003e Visibilty, project features, permissions -\u003e expand\nPackage registry -\u003e Allow anyone to pull from Package Registry (activate) -\u003e Save\n\n(Pull from the group)\nClick the published version in the package registry to see how to pull:\n```shell\npython3 -m pip install applyllm --no-deps --no-cache-dir --index-url https://gitlab.lrz.de/api/v4/projects/150553/packages/pypi/simple --trusted-host https://gitlab.lrz.de\n```\n* pull from the group https://docs.gitlab.com/ee/user/packages/pypi_repository/#install-from-the-group-level\n* install your private gitlab pypi package https://stackoverflow.com/questions/2477117/pip-requirements-txt-with-alternative-index/2477610#2477610\n\n## Publish a PyPI package by using twine\nLocal without CI/CD\n```shell\npackage=\"./ApplyLlm\";\ncd $package;\npython3 -m twine upload --repository gitlab-lrz dist/*\n```\n\nYou shall see the \"package/tag\" in the package registry\n\n## Makefile **space 4 issue\nMakefile need tab as indent, not space 4\n* https://stackoverflow.com/questions/16931770/makefile4-missing-separator-stop/72198029#72198029\n\n## Reference:\n* build python resource package .whl https://docs.gitlab.com/ee/user/packages/workflows/build_packages.html#pypi\n* upload .whl to the package registry https://docs.gitlab.com/ee/user/packages/pypi_repository/#install-from-the-group-level\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyingding%2Fllm-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyingding%2Fllm-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyingding%2Fllm-examples/lists"}