{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/llamaduo-llmops-pipeline-for-seamless","title":"LlamaDuo: LLMOps Pipeline for Seamless Migration from Service LLMs to Small-Scale Local LLMs","arxiv_id":"2408.13467","date":"2024-08-24","proceeding":null,"authors":["Chansung Park","Juyong Jiang","Fan Wang","Sayak Paul","Jing Tang"],"abstract":"The widespread adoption of cloud-based proprietary large language models (LLMs) has introduced significant challenges, including operational dependencies, privacy concerns, and the necessity of continuous internet connectivity. In this work, we introduce an LLMOps pipeline, \"LlamaDuo\", for the seamless migration of knowledge and abilities from service-oriented LLMs to smaller, locally manageable models. This pipeline is crucial for ensuring service continuity in the presence of operational failures, strict privacy policies, or offline requirements. Our LlamaDuo involves fine-tuning a small language model against the service LLM using a synthetic dataset generated by the latter. If the performance of the fine-tuned model falls short of expectations, it is automatically improved through additional fine-tuning using extra similar data generated by the service LLM. This multi-turn process guarantees that the smaller model can eventually match or even surpass the service LLM's capabilities in specific downstream tasks, offering a practical and scalable solution for managing AI deployments in constrained environments. Extensive experiments with leading-edge LLMs are conducted to demonstrate the effectiveness, adaptability, and affordability of LlamaDuo across various downstream tasks. Our pipeline implementation is available at https://github.com/deep-diver/llamaduo.","url_abs":"https://arxiv.org/abs/2408.13467v3","url_pdf":"https://arxiv.org/pdf/2408.13467v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"llamaduo-llmops-pipeline-for-seamless","repo_url":"https://github.com/deep-diver/llamaduo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"small-language-model","task_name":"Small Language Model"}],"methods":[{"method_slug":null,"method_name":null}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2408.13467","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.13467"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/deep-diver/llamaduo","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":10,"unverified":4},"by_repo_kind":{"official":{"samples":14,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"46b3bd49851e747b","entry":"call_service_llm","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/utils.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"46b3bd49851e747b"}},{"code_sha256_prefix":"5b051bbcaa7714d9","entry":"cleanup_ds","repo":"deep-diver/llamaduo","repo_kind":"official","path":"dataset_merge.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/dataset_merge.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b051bbcaa7714d9"}},{"code_sha256_prefix":"0ab58512e22ed49f","entry":"collage_as_dataset","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/pipeline/synth_data_gen.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/pipeline/synth_data_gen.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0ab58512e22ed49f"}},{"code_sha256_prefix":"966485e1f476ef37","entry":"craft_prompt","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/async_generate_data_gemini.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/async_generate_data_gemini.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"966485e1f476ef37"}},{"code_sha256_prefix":"67e2dea755355a23","entry":"find_json_snippet","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/collate_as_datasets.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/collate_as_datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"67e2dea755355a23"}},{"code_sha256_prefix":"5b706a41d8a78def","entry":"format_response","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/collate_as_datasets.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/collate_as_datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b706a41d8a78def"}},{"code_sha256_prefix":"1067596b265450c1","entry":"generate_async","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/gemini.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/gemini.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1067596b265450c1"}},{"code_sha256_prefix":"a1849d123c6ba549","entry":"generate_text","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/async_generate_data_gemini.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/async_generate_data_gemini.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a1849d123c6ba549"}},{"code_sha256_prefix":"5a05b366cd7e1ed8","entry":"is_push_to_hf_hub_enabled","repo":"deep-diver/llamaduo","repo_kind":"official","path":"utils.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5a05b366cd7e1ed8"}},{"code_sha256_prefix":"a27454db22d18423","entry":"load_all_json_files","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/collate_as_datasets.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/collate_as_datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a27454db22d18423"}},{"code_sha256_prefix":"f533d60c6a9bbd90","entry":"gen_local_lm_responses","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/pipeline/batch_inference.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/pipeline/batch_inference.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f533d60c6a9bbd90"}},{"code_sha256_prefix":"433721422ea96a6b","entry":"gen_model_outputs","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/local_lm.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/local_lm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"433721422ea96a6b"}},{"code_sha256_prefix":"12e77bbcdff15306","entry":"get_model","repo":"deep-diver/llamaduo","repo_kind":"official","path":"src/gen/local_lm.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/src/gen/local_lm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"12e77bbcdff15306"}},{"code_sha256_prefix":"d09622f684fbfbc1","entry":"update_args","repo":"deep-diver/llamaduo","repo_kind":"official","path":"utils.py","file_url":"https://github.com/deep-diver/llamaduo/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d09622f684fbfbc1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}