\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\n2025\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\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>=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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "2a5c7497f6ad9dc5bd17d1df04bee0357e23cd64": {"t": 1785766593.471151, "n": 13984, "h": "6128bf119687bd24", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "369c0bc515632c818d4614522918d257926493ed": {"t": 1785766594.856456, "n": 13997, "h": "8dd999e992d92d09", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [×] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "4007fc1c1685f17bce259c45ed290af167fd1577": {"t": 1785766596.199877, "n": 13951, "h": "080a62647301f1e1", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [×] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "da74126b488a60cdb809a364ba8f87c184798857": {"t": 1785766597.6626592, "n": 13948, "h": "fba49bdbb470c7f4", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [×] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "28e2204615df2a6067925c1453996acd52a8fbdc": {"t": 1785766599.190431, "n": 13948, "h": "39534709cf10bea8", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [×] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "4c361f9bdf682b08ad4d4102be2ecda6ea725023": {"t": 1785766600.8121855, "n": 13950, "h": "d8c1d2ba31cc901f", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [ × ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "d2c5f5e384ce2053b3ec2743342eb9bc5b6f20b5": {"t": 1785766602.21219, "n": 13948, "h": "39534709cf10bea8", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [×] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "8c9aa0f2cb355e04b3cb6d8add784cd184237ee4": {"t": 1785766603.8098416, "n": 13948, "h": "3b13c57e453226b6", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "bb66de3aaac1ffb0e4cda97159a3e9f76a00859a": {"t": 1785766605.377494, "n": 13948, "h": "6291f0f268a5890e", "c": "# EDG4LLM\n\n
\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\n2025\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\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "ce61d02a54f2164eed3e558b0da262aebce21fc7": {"t": 1785766606.8350418, "n": 13970, "h": "7fc096e716522a35", "c": "# EDG4LLM\n\n
\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\n2025\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\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- [License](#license)\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "bfe884b28fb7858288814d775243c589e0ea81e8": {"t": 1785766608.5690782, "n": 13965, "h": "ce6eb649cb5a9904", "c": "# EDG4LLM\n\n
\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\n2025\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\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- [License](#license)\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "db5a5996a0b1c7dcd4dad20872a867a59b6a1207": {"t": 1785766610.1864004, "n": 13885, "h": "a7903842aac3d466", "c": "# EDG4LLM\n\n
\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\n2025\n\n- [2025/01/28] 🚀🎉 We've added support for **DeepSeek-R1** and **InternLM3** models! 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\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- [License](#license)\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "3fb6ff13a564844d1438b342c057e7a753497fcc": {"t": 1785766611.5939236, "n": 13772, "h": "e74f4624393888a1", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n5. - [ ] 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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "f11d362ed5dcae0c69c21538d89930991d73f80e": {"t": 1785766613.0004342, "n": 13727, "h": "875e945edfce594b", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "38cfb9612105df64144968a2cb7df9e8bdb8ee5e": {"t": 1785766614.585872, "n": 13726, "h": "1c0ee43537d3f27b", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "18d9caebcaf246d5e6a629c2b0655ff2473b2bba": {"t": 1785766615.9187415, "n": 13511, "h": "df82bb2f2d2173ca", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "a9a714fb7d6e226a73a9ee5ed2fc0cb6dcf33dbc": {"t": 1785766617.5632892, "n": 13453, "h": "f787d5070be1369a", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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** |\n|--------------------|------------------|------------------------------------------------------------|\n| **InternLM** | Yes(Partly) | `https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions` |\n| **ChatGLM** | Yes(Partly) | `https://open.bigmodel.cn/api/paas/v4/chat/completions/` |\n| **DeepSeek** | Yes(Free Trial for New Users) | `https://api.deepseek.com/chat/completions` |\n| **OpenAI ChatGPT** | No (Paid Plans) | `https://api.openai.com/v1/chat/completions` |\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "14d69526e2f8cc2a7cd7557bc618fecd0e961da3": {"t": 1785766618.86984, "n": 13044, "h": "2540b6d2a799734b", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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** |\n|--------------------|------------------|------------------------------------------------------------|\n| **InternLM** | Yes(Partly) | `https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions` |\n| **ChatGLM** | Yes(Partly) | `https://open.bigmodel.cn/api/paas/v4/chat/completions/` |\n| **DeepSeek** | Yes(Free Trial for New Users) | `https://api.deepseek.com/chat/completions` |\n| **OpenAI ChatGPT** | No (Paid Plans) | `https://api.openai.com/v1/chat/completions` |\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\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "8baec83a55fa39f2af2622edffa3ebeebecd617e": {"t": 1785766620.3157918, "n": 12537, "h": "d908cdadf7fa4003", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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** |\n|--------------------|------------------|------------------------------------------------------------|\n| **InternLM** | Yes(Partly) | `https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions` |\n| **ChatGLM** | Yes(Partly) | `https://open.bigmodel.cn/api/paas/v4/chat/completions/` |\n| **DeepSeek** | Yes(Free Trial for New Users) | `https://api.deepseek.com/chat/completions` |\n| **OpenAI ChatGPT** | No (Paid Plans) | `https://api.openai.com/v1/chat/completions` |\n\n\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "5bf1a58d5b4fe9ac4870fd52bd38040413d73b7d": {"t": 1785766621.729706, "n": 12327, "h": "cc7cb78a351d3bfe", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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** |\n|--------------------|------------------|------------------------------------------------------------|\n| **InternLM** | Yes(Partly) | `https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions` |\n| **ChatGLM** | Yes(Partly) | `https://open.bigmodel.cn/api/paas/v4/chat/completions/` |\n| **DeepSeek** | Yes(Free Trial for New Users) | `https://api.deepseek.com/chat/completions` |\n| **OpenAI ChatGPT** | No (Paid Plans) | `https://api.openai.com/v1/chat/completions` |\n\n\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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\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:\nUse the generate method with the following parameters:\n - task_type: Defines the type of task (e.g., dialogue, question-answering).\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "9d8acec8e7a14fbc7497b1511e555c045bc2c141": {"t": 1785766623.2913697, "n": 11997, "h": "fbebf355ef94cc32", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n- [Contact us](#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** |\n|--------------------|------------------|------------------------------------------------------------|\n| **InternLM** | Yes(Partly) | `https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions` |\n| **ChatGLM** | Yes(Partly) | `https://open.bigmodel.cn/api/paas/v4/chat/completions/` |\n| **DeepSeek** | Yes(Free Trial for New Users) | `https://api.deepseek.com/chat/completions` |\n| **OpenAI ChatGPT** | No (Paid Plans) | `https://api.openai.com/v1/chat/completions` |\n\n\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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\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:\nUse the generate method with the following parameters:\n - task_type: Defines the type of task (e.g., dialogue, question-answering).\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "ce7adedf76f20e1ee453d8d1e5146c31c52e3fc8": {"t": 1785766624.9566712, "n": 10737, "h": "e152fcb39e4bdd24", "c": "# EDG4LLM\n\n
\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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#disclaimer)\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\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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\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:\nUse the generate method with the following parameters:\n - task_type: Defines the type of task (e.g., dialogue, question-answering).\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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## Star History\n\n[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "637a2547c6da81a1637ceabe322bca3addaaaf4b": {"t": 1785766626.3155289, "n": 10725, "h": "6bdb06a988ddbd1f", "c": "# EDG4LLM\n\n
\n\n\nEasy 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\n2025\n\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\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#disclaimer)\n- [Star History](#star-history)\n\n## Introduction\nedg4llm 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\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- [**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\nMore providers will be added in future updates to extend compatibility and functionality. \n\n\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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\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:\nUse the generate method with the following parameters:\n - task_type: Defines the type of task (e.g., dialogue, question-answering).\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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| [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| [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| [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## Star History\n\n[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "775c5bc13c509e1f0ebb8acafc3da0633667c0b0": {"t": 1785766627.726175, "n": 10725, "h": "4166cab555dc75ad", "c": "# EDG4LLM\n\n
\n\n\nEasy 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## 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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#disclaimer)\n- [Star History](#star-history)\n\n## Latest News\n\n\n2025\n\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\n\n## Introduction\nedg4llm 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\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- [**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\nMore providers will be added in future updates to extend compatibility and functionality. \n\n\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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\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:\nUse the generate method with the following parameters:\n - task_type: Defines the type of task (e.g., dialogue, question-answering).\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>=2.32.3\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\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| [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| [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| [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## Star History\n\n[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "cbc5122cce8516e473425f71f7261a1a52dba017": {"t": 1785766629.0760424, "n": 7365, "h": "74f7380c6e5184b6", "c": "# EDG4LLM\n\n
\n\n\n\nEasy Data Generation For Large Language Model, A unified tool to generate fine-tuning datasets for LLMs, including questions, answers, and dialogues.\n\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [License](#disclaimer)\n- [Star History](#star-history)\n\n## Latest News\n\n\n2025\n\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\n\n## Introduction\n$\\quad$ 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\n$\\quad$ With 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\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. **High Efficiency**: Utilizes an optimized generation mechanism to quickly produce large volumes of high-quality fine-tuning data.\n4. **Flexibility**: Supports a variety of data formats and generation options, allowing customization to meet specific needs.\nCompatibility: Seamlessly integrates with mainstream large language models and is suitable for various development scenarios.\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### LLM Provider\nThe current version of edg4llm supports the following large language model providers:\n\n- **ChatGLM**: A versatile LLM optimized for various text generation tasks.\n- **DeepSeek**: A powerful and efficient LLM for fine-tuned applications.\n- **OpenAI ChatGPT**: The widely-used conversational AI from OpenAI.\n- **InternLM**: A robust LLM tailored for enterprise and advanced use cases.\n\nMore providers will be added in future updates to extend compatibility and functionality. \n\n\n## Quick Start\n\nTo get started with **edg4llm**, follow the steps below. This example demonstrates how to use the library to generate dialogue data based on a specific prompt.\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.\n3. Obtain the necessary API key and base URL for your chosen model provider (e.g., ChatGLM).\n\n### Code Example\n```python\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\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:\nUse the generate method with the following parameters:\n - task_type: Defines the type of task (e.g., dialogue, question-answering).\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\n\n- Only require requests\n\n## License\nMIT License - See [LICENSE](LICENSE) for details.\n\n## Future Development Plans\n1. - [ ] Recording Introduction Video\n2. - [ ] Support Gemini2\n3. - [ ] Support local large language models\n4. - [ ] Support other types of data, such as picture.\n\n## Acknowledgments\n| Project | Description |\n|---|---|\n| [InternLM](https://github.com/InternLM/InternLM) | A series of advanced open-source large language models |\n| [FunGPT](https://github.com/Alannikos/FunGPT) | An open-source Role-Play project |\n\n## License\nMIT License - See [LICENSE](LICENSE) for details.\n\n## Star History\n\n[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "df5247f6190d691a1bd164508be3312b0e5b5b44": {"t": 1785766630.601463, "n": 4857, "h": "e093aea29e9c5ce9", "c": "# EDG4LLM\n\n
\n\n\n\nEasy Data Generation For Large Language Model, A unified tool to generate fine-tuning datasets for LLMs, including questions, answers, and dialogues.\n\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [Disclaimer](#disclaimer)\n\n## Latest News\n\n\n2025\n\n- [2025/01/11] 👋👋 \n\n\n\n## Introduction\n$\\quad$ 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\n$\\quad$ With 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\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. **High Efficiency**: Utilizes an optimized generation mechanism to quickly produce large volumes of high-quality fine-tuning data.\n4. **Flexibility**: Supports a variety of data formats and generation options, allowing customization to meet specific needs.\nCompatibility: Seamlessly integrates with mainstream large language models and is suitable for various development scenarios.\n\n## Installation\n\n```bash\npip install edg4llm\n```\n\n### Supported Python Versions\n- Python >= 3.8\n\n### LLM Provider\n\n- ChatGLM\n- DeepSeek\n- OpenAI ChatGPT\n- InternLM\n\n## Quick Start\n\n```python\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\n## Requirements\n\n## License\nMIT License - See [LICENSE](LICENSE) for details.\n\n## Future Development Plans\n\n## Acknowledgments\n\n## Disclaimer\n\n\n\n## Star History\n\n[](https://star-history.com/#Alannikos/edg4llm&Date)"}, "6bb5470211d19b17d6178463af091416e2a81c76": {"t": 1785766631.9105356, "n": 4695, "h": "21819f8a268eb387", "c": "# EDG4LLM\n\n
\n\n\n\nEasy Data Generation For Large Language Model, A unified tool to generate fine-tuning datasets for LLMs, including questions, answers, and dialogues.\n\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- [License](#license)\n- [Future Development Plans](#future-development-plans)\n- [Acknowledgments](#acknowledgments)\n- [Disclaimer](#disclaimer)\n\n## Latest News\n\n\n2025\n\n- [2025/01/11] 👋👋 \n\n\n\n## Introduction\n$\\quad$ 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\n$\\quad$ With 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\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. **High Efficiency**: Utilizes an optimized generation mechanism to quickly produce large volumes of high-quality fine-tuning data.\n4. **Flexibility**: Supports a variety of data formats and generation options, allowing customization to meet specific needs.\nCompatibility: Seamlessly integrates with mainstream large language models and is suitable for various development scenarios.\n\n## Installation\n\n```bash\npip install edg4llm\n```\n\n### Supported Python Versions\n- Python >= 3.8\n\n### LLM Provider\n\n- ChatGLM\n- DeepSeek\n- OpenAI ChatGPT\n- InternLM\n\n## Quick Start\n\n```python\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\n## Requirements\n\n## License\nMIT License - See [LICENSE](LICENSE) for details.\n\n## Future Development Plans\n\n## Acknowledgments\n\n## Disclaimer"}, "c638b3361cc0137757441f424c63a9e03115d247": {"t": 1785766633.494459, "n": 2547, "h": "aff8884b5a2cb1b6", "c": "# EDG4LLM\n\n