{"id":37063711,"url":"https://github.com/alannikos/edg4llm","last_synced_at":"2026-01-14T07:17:31.235Z","repository":{"id":271963425,"uuid":"913317433","full_name":"Alannikos/edg4llm","owner":"Alannikos","description":"A unified tool to generate fine-tuning datasets for LLMs, including questions, answers, and dialogues. ✨🤖📚💬","archived":false,"fork":false,"pushed_at":"2025-03-14T07:15:30.000Z","size":4178,"stargazers_count":61,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-29T07:07:38.398Z","etag":null,"topics":["chagpt","chatglm","data","deepseek","fine-tuning","generation","internlm","llm"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/edg4llm/","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/Alannikos.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":"2025-01-07T13:01:08.000Z","updated_at":"2025-07-31T15:32:16.000Z","dependencies_parsed_at":"2025-01-11T04:17:52.074Z","dependency_job_id":"bfcc7f2a-e287-4639-a901-46f8f3a3fcd1","html_url":"https://github.com/Alannikos/edg4llm","commit_stats":null,"previous_names":["alannikos/edg4llm"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Alannikos/edg4llm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alannikos%2Fedg4llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alannikos%2Fedg4llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alannikos%2Fedg4llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alannikos%2Fedg4llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alannikos","download_url":"https://codeload.github.com/Alannikos/edg4llm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alannikos%2Fedg4llm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chagpt","chatglm","data","deepseek","fine-tuning","generation","internlm","llm"],"created_at":"2026-01-14T07:17:30.497Z","updated_at":"2026-01-14T07:17:31.223Z","avatar_url":"https://github.com/Alannikos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EDG4LLM\n\n\u003cdiv align=\"center\"\u003e\n\n![welcome](assets/welcome.png)\n\u003c!-- ```\n      __      __  __        __   ___  __     __  __   __                     \n|  | |_  |   /   /  \\ |\\/| |_     |  /  \\   |_  |  \\ / _   |__| |   |   |\\/| \n|/\\| |__ |__ \\__ \\__/ |  | |__    |  \\__/   |__ |__/ \\__)     | |__ |__ |  | \n                                                                             \n``` --\u003e\n\n  [English](README.md) | [简体中文](README_zh.md)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[📘Documentation](https://github.com/alannikos/edg4llm) |\n[🛠️Quick Start](https://github.com/alannikos/edg4llm) |\n[🤔Reporting Issues](https://github.com/alannikos/edg4llm/issues) \n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n[![GitHub Issues](https://img.shields.io/github/issues/Alannikos/edg4llm?style=flat\u0026logo=github\u0026color=%23FF5252)](https://github.com/Alannikos/edg4llm/issues)\n[![GitHub forks](https://img.shields.io/github/forks/Alannikos/edg4llm?style=flat\u0026logo=github\u0026color=%23FF9800)](https://github.com/Alannikos/edg4llm/forks)\n![GitHub Repo stars](https://img.shields.io/github/stars/Alannikos/edg4llm?style=flat\u0026logo=github\u0026color=%23FFEB3B)\n![GitHub License](https://img.shields.io/github/license/Alannikos/edg4llm?style=flat\u0026logo=github\u0026color=%234CAF50)\n[![Discord](https://img.shields.io/discord/1327445853388144681?style=flat\u0026logo=discord)](https://discord.com/channels/1327445853388144681/)\n[![Bilibili](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.bilibili.com%2Fx%2Frelation%2Fstat%3Fvmid%3D3494365446015137\u0026query=%24.data.follower\u0026style=flat\u0026logo=bilibili\u0026label=followers\u0026color=%23FF69B4)](https://space.bilibili.com/3494365446015137)\n[![PyPI - Version](https://img.shields.io/pypi/v/edg4llm?style=flat\u0026logo=pypi\u0026logoColor=blue\u0026color=red)](https://pypi.org/project/edg4llm/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/edg4llm?color=blue\u0026logo=pypi\u0026logoColor=gold)](https://pypistats.org/packages/edg4llm)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/edg4llm?logo=python\u0026logoColor=gold)](https://pypi.org/project/edg4llm/)\n\u003c/div\u003e\n\n\n**Easy Data Generation For Large Language Model(abbreviated as  EDG4LLM)**, A unified tool to generate fine-tuning datasets for LLMs, including questions, answers, and dialogues.\n\n\n## Latest News\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003e2025\u003c/b\u003e\u003c/summary\u003e\n\n- [2025/01/28] 🚀🎉 We've added support for **DeepSeek-R1** and **InternLM3** models: the release of edg4llm [**v1.0.18**](https://pypi.org/project/edg4llm/1.0.18/). Stay tuned for more updates!\n- [2025/01/12] 📢📺 We've released a project introduction video! You can find the video on [Bilibili](https://www.bilibili.com/video/BV1MccVeyEHp/). If you like it, don't forget to give it a thumbs up 👍 and follow us!\n- [2025/01/11] 👋👋 We are excited to announce the initial release of edg4llm [**v1.0.12**](https://pypi.org/project/edg4llm/1.0.12/), marking the completion of its core functionalities. \n\n\u003c/details\u003e\n\n## Table of Contents\n- [Latest News](#latest-news)\n- [Introduction](#introduction)\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Requirements](#requirements)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact me](#contact-me)\n- [Star History](#star-history)\n\n## Introduction\n**edg4llm** is a Python library designed specifically for generating fine-tuning data using large language models. This tool aims to assist users in creating high-quality training datasets efficiently. At its current stage, it mainly supports text data generation. The generated data includes, but is not limited to:\n- **Question data**\n- **Answer data**\n- **Dialogue data**\n\nWith **edg4llm**, users can easily produce diverse datasets tailored to fine-tuning requirements, significantly enhancing the performance of large language models in specific tasks.\n## Features\nEDG4LLM is a unified tool designed to simplify and accelerate the creation of fine-tuning datasets for large language models. With a focus on usability, efficiency, and adaptability, it offers a range of features to meet diverse development needs while ensuring seamless integration and robust debugging support.\n\n1. **Simple to Use**: Provides a straightforward interface that allows users to get started without complex configurations.\n2. **Lightweight**: Minimal dependencies and low resource consumption make it efficient and easy to use.\n3. **Flexibility**: Supports a variety of data formats and generation options, allowing customization to meet specific needs.\n4. **Compatibility**: Seamlessly integrates with mainstream large language models and is suitable for various development scenarios.\n5. **Transparent Debugging**: Provides clear and detailed log outputs, making it easy to debug and trace issues effectively.\n\n## Installation\nTo install **edg4llm**, simply run the following command in your terminal:\n\n\n```bash\npip install edg4llm\n```\n\n### Supported Python Versions\n- **Supported Python Versions**: Python 3.8 or higher is required for compatibility with this library. Ensure your environment meets this version requirement.\n\n### Supported LLM Provider\nThe current version of edg4llm supports the following large language model providers:\n- [**InternLM**](https://github.com/InternLM)\n    - Developer: Developed by the Shanghai Artificial Intelligence Laboratory.\n    - Advantages: InternLM is a series of open-source large language models that offer outstanding reasoning, long-text processing, and tool usage capabilities. \n\n- [**ChatGLM**](https://github.com/THUDM/)\n    - Developer: Jointly developed by Tsinghua University and Zhipu AI.\n    - Advantages: ChatGLM is an open-source, bilingual dialog language model based on the General Language Model (GLM) architecture. It has been trained on a large corpus of Chinese and English text, making it highly effective for generating natural and contextually relevant responses.\n- [**DeepSeek**](https://github.com/deepseek-ai/)\n    - Developer: Developed by the DeepSeek team.\n    - Advantages: DeepSeek-V3 is a powerful and cost-effective open-source large language model. It offers top-tier performance, especially in tasks like language generation, question answering, and dialog systems.\n- [**OpenAI ChatGPT**](https://chatgpt.com/)\n    - Developer: Developed by OpenAI.\n    - Advantages: OpenAI's ChatGPT is a highly advanced language model known for its robust text generation capabilities. It has been trained on a vast amount of data, allowing it to generate high-quality and contextually relevant responses. \n\nMore providers will be added in future updates to extend compatibility and functionality. \n\n| **Model**         | **Free**         | **Base URL**                                               | **Model Provider** |\n|--------------------|------------------|------------------------------------------------------------|--------------------|\n| **InternLM**       | Yes(Partly)       | `https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions` | `internlm` |\n| **ChatGLM**        | Yes(Partly)       | `https://open.bigmodel.cn/api/paas/v4/chat/completions/`   | `chatglm`  |\n| **DeepSeek**       | Yes(Free Trial for New Users) | `https://api.deepseek.com/chat/completions` | `deepseek` |\n| **OpenAI ChatGPT** | No (Paid Plans)   | `https://api.openai.com/v1/chat/completions`               | `chatgpt`   |\n\n\n## Quick Start\nTo get started with **edg4llm**, follow the steps below. These examples demonstrate how to use the library to generate dialogue data based on a specific prompt.\n\n### **Attention!**\n\nIf you want to use `question` mode, please assure that your user_prompt contains the following format:\n\n```json\n[\n    {\n        \"question\": \"AAA\"\n    }\n]\n```\n\nIf you want to use `answer` mode, please assure that your user_prompt contains the following format:\n\n```json\n[\n    {\n        \"answer\": \"AAA\"\n    }\n]\n```\n\nIf you want to use `dialogue` mode, please assure that your user_prompt contains the following format:\n\n```json\n[\n    {{\n        \"input\":\"AAA\",\"output\":\"BBB\" \n    }}\n]\n```\n\n### Prerequisites\n\n1. Install the **edg4llm** package:\n```bash\n   pip install edg4llm\n```\n\n2. Ensure you have Python version 3.8 or higher.\n\n3. Obtain the necessary API key and base URL for your chosen model provider (e.g., ChatGLM).\n\n4. you can use the CLI to list the supported model_providers and model_names\n\n```\nusage: edg4llm-cli [-h] [--list-providers] [--list-models PROVIDER]\n\nView the list of supported models.\n\noptions:\n  -h, --help            show this help message and exit\n  --list-providers      List all supported providers.\n  --list-models PROVIDER\n                        View the list of models for a specific provider.\n```\n\n### Code Example(Chinese Version)\n```python\n# chatglm_demo.py\n\nimport edg4llm\nprint(edg4llm.__version__)\n\nfrom edg4llm import EDG4LLM\n\napi_key = \"xxx\"\nbase_url = \"https://open.bigmodel.cn/api/paas/v4/chat/completions\"\n\nedg = EDG4LLM(model_provider='chatglm', model_name=\"glm-4-flash\", base_url=base_url, api_key=api_key)\n# 设置测试数据\nsystem_prompt = \"\"\"你是一个精通中国古代诗词的古文学大师\"\"\"\n\nuser_prompt = \"\"\"\n    目标: 1. 请生成过年为场景的连续多轮对话记录\n            2. 提出的问题要多样化。\n            3. 要符合人类的说话习惯。\n            4. 严格遵循规则: 请以如下格式返回生成的数据, 只返回JSON格式，json模板:  \n                [\n                    {{\n                        \"input\":\"AAA\",\"output\":\"BBB\" \n                    }}\n                ]\n                其中input字段表示一个人的话语, output字段表示专家的话语\n\"\"\"\nnum_samples = 1  # 只生成一个对话样本\n\n# 调用 generate 方法生成对话\ndata_dialogue = edg.generate(\n    task_type=\"dialogue\",\n    system_prompt=system_prompt,\n    user_prompt=user_prompt,\n    num_samples=num_samples\n)\n```\n### Code Example(English Version)\n```python\n# chatglm_demo.py\n\nimport edg4llm\nprint(edg4llm.__version__)\n\nfrom edg4llm import EDG4LLM\n\napi_key = \"xxx\"\nbase_url = \"https://open.bigmodel.cn/api/paas/v4/chat/completions\"\n\nedg = EDG4LLM(model_provider='chatglm', model_name=\"glm-4-flash\", base_url=base_url, api_key=api_key)\n\n# Set the test data\nsystem_prompt = \"\"\"You are a master of ancient Chinese literature, specializing in classical poetry.\"\"\"\n\nuser_prompt = \"\"\"\n    Goal: 1. Please generate a multi-turn dialogue set in the context of celebrating the Lunar New Year.\n          2. The questions should be diverse.\n          3. The dialogue should align with natural human conversational habits.\n          4. Strictly follow this rule: Please return the generated data in the following format, only in JSON format. JSON template:  \n                [\n                    {{\n                        \"input\":\"AAA\",\"output\":\"BBB\" \n                    }}\n                ]\n                Where the input field represents a person's dialogue, and the output field represents the expert's response.\n\"\"\"\nnum_samples = 1  # Generate only one dialogue sample\n\n# Call the generate method to generate the dialogue\ndata_dialogue = edg.generate(\n    task_type=\"dialogue\",\n    system_prompt=system_prompt,\n    user_prompt=user_prompt,\n    num_samples=num_samples\n)\n\n```\n\n### Explanation\n\n1. Importing the Library: Import the edg4llm library and verify the version using print(edg4llm.__version__).\n\n2. Initialization: Use EDG4LLM to initialize the library with the appropriate model provider, model name, base URL, and API key.\n\n3. Prompts:\n    - system_prompt defines the behavior or role of the assistant.\n    - user_prompt provides specific instructions for generating data.\n4. Data Generation: Use the generate method with the following parameters:\n    - task_type: Defines the type of task.\n        - dialogue: generate the question-answer pairs according to the prompt.\n        - question: generate the question data according to the prompt.\n        - answer: generate the answer data according to the questions and the prompt.\n        \n    - system_prompt and user_prompt: Provide context and task-specific instructions.\n    - num_samples: Specifies how many samples to generate.\n5. Output: The generated data is returned as a JSON object in the specified format.\n\n## Requirements\nThis project has **minimal dependencies**, requiring only the requests library. Make sure to have the following version installed:\n\n- requests\u003e=2.32.3\n\n## Future Development Plans\n- [x] Recording Introduction Video\n- [ ] Support Gemini2\n- [ ] Support local large language models\n- [ ] Support other types of data, such as picture.\n- [ ] preprocess the base_url and api_key\n\n## Acknowledgments\n| Project | Description |\n|---|---|\n| [FunGPT](https://github.com/Alannikos/FunGPT) | An open-source Role-Play project |\n| [InternLM](https://github.com/InternLM/InternLM) | A series of advanced open-source large language models |\n| [ChatGLM](https://github.com/THUDM/) | A bilingual dialog language model based on the General Language Model (GLM) architecture, jointly developed by Tsinghua University and Zhipu AI. |\n| [DeepSeek](https://github.com/deepseek-ai/) | A powerful and cost-effective open-source large language model, excelling in tasks such as language generation, question answering, and dialog systems. |\n| [ChatGPT](https://openai.com/chatgpt/) | A highly advanced language model developed by OpenAI, known for its robust text generation capabilities. |\n\n## License\nMIT License - See [LICENSE](LICENSE) for details.\n\n## Contact Me\nThank you for using **EDG4LLM**! Your support and feedback are invaluable in making this project better.\n\nIf you encounter any issues, have suggestions, or simply want to share your thoughts, feel free to:\n- Submit an Issue: Visit the [Issues Page](https://github.com/Alannikos/edg4llm/issues) and describe the problem or suggestion.\n- Email Me: You can also reach out directly via email at alannikos768@outlook.com. I'll do my best to respond promptly.\n\nYour contributions and feedback are greatly appreciated. Thank you for helping improve this tool!\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Alannikos/edg4llm\u0026type=Date)](https://star-history.com/#Alannikos/edg4llm\u0026Date)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falannikos%2Fedg4llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falannikos%2Fedg4llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falannikos%2Fedg4llm/lists"}