{"id":19914810,"url":"https://github.com/roialfassi/promptqueuerunner","last_synced_at":"2026-05-05T01:37:55.588Z","repository":{"id":232182229,"uuid":"783675696","full_name":"Roialfassi/PromptQueueRunner","owner":"Roialfassi","description":"automate the batching and execution of prompts.","archived":false,"fork":false,"pushed_at":"2024-06-24T07:25:40.000Z","size":9601,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T09:39:59.257Z","etag":null,"topics":["ai","ai-automation","llama","llm","lm-studio","local-llm","openai","openai-api-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Roialfassi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-08T11:02:30.000Z","updated_at":"2024-06-24T07:25:43.000Z","dependencies_parsed_at":"2024-06-24T08:45:53.552Z","dependency_job_id":"b77a5b0d-c55c-46ad-b5d7-95c1c13a1155","html_url":"https://github.com/Roialfassi/PromptQueueRunner","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"e7b1f45c9fd45dafe8af8c844d5805ca426a9e57"},"previous_names":["roialfassi/promptqueuerunner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roialfassi%2FPromptQueueRunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roialfassi%2FPromptQueueRunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roialfassi%2FPromptQueueRunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roialfassi%2FPromptQueueRunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Roialfassi","download_url":"https://codeload.github.com/Roialfassi/PromptQueueRunner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241342844,"owners_count":19947278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-automation","llama","llm","lm-studio","local-llm","openai","openai-api-python"],"created_at":"2024-11-12T21:37:12.116Z","updated_at":"2026-05-05T01:37:55.536Z","avatar_url":"https://github.com/Roialfassi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PromptQueueRunner\nThis Python script allows you to query a locally hosted Large Language Model (LLM) with multiple prompts and save the responses to text files. It provides a command-line interface for easy usage and configuration.\n\n### Prerequisites\n* Python 3.8+\n* openai library (install with pip install openai)\n\n### Usage\n* Clone or download the repository to your local machine.\n* Change the credentials to the api you are willing to use\n\nif you are using LM studio then it is:\n```json\n{\n    \"base_url\": \"http://localhost:1234/v1\",\n    \"api_key\": \"lm-studio\"\n}\n```\nReplace the values for \"base_url\" and \"api_key\" with the appropriate values\nCreate a JSON file (e.g., prompts.json) containing an array of prompt and title dictionaries. Example:\n```json\n[\n    {\n        \"prompt\": \"Introduce yourself.\",\n        \"title\": \"llm_introduction\"\n    },\n    {\n        \"prompt\": \"What is the meaning of life?\",\n        \"title\": \"meaning_of_life\"\n    },\n    {\n        \"prompt\": \"Describe your favorite food.\",\n        \"title\": \"favorite_food\"\n    }\n]\n```\nOpen a terminal or command prompt and navigate to the project directory.\nOpen venv install requirements and then\nRun the script with the following command:\n```bash\npython PromptQueueRunner.py -p prompts.json\n```\nThis will process the prompts from the prompts.json file, query the local LLM with each prompt, and save the responses in the output/general folder with the corresponding titles as filenames.\n\n## Command-line Arguments\nThe script supports the following command-line arguments:\n* -p or --prompts: Path to the JSON file containing prompts and titles (required).\n* -c or --credentials: Path to the JSON file containing LLM credentials (default: credentials.json).\n* -o or --output: Path to the output folder where the response files will be saved (default: output).\n* -t or --topic: Topic subfolder within the output folder where the response files will be saved (default: general).\n* -s or --system: System role (instructions for the LLM) (default: \"Always answer in rhymes.\").\n\nYou can use the --help argument to display the help message and the available options:\n```bash\npython PromptQueueRunner.py --help\n```\n## Example\nTo run the script with custom options, use the following format:\n\n```bash\npython PromptQueueRunner.py -p prompts.json -c my_credentials.json -o my_output --topic science -s \"Please respond in a scientific tone.\"\n```\nThis will process the prompts from the prompts.json file, load the LLM credentials from the my_credentials.json file, save the responses in the my_output/science folder, and use the system role \"Please respond in a scientific tone.\" when querying the LLM.\n\n## Notes\n* The script sanitizes the titles to ensure they are valid filenames. Characters that are not alphanumeric, underscore, hyphen, period, or parentheses are removed, and spaces are replaced with underscores.\n* The responses from the LLM are saved as plain text files with the sanitized title as the filename.\n* Make sure to update the credentials.json file with the correct credentials for your local LLM server.\n* You can modify the prompts.json file to include different prompts and titles as needed.\n\n## Creating prompts.json \nGo to GPT or Claude and enter the following prompt:\n```text\nCan you write me a json array with 30 prompts for \n{Your Subject}\neach of the elements should have \"title\" and \"prompt\" \ntitle explains the objective of the prompt in 1 line\nand prompt is the prompt itself\n```\nThen copy the prompts to the json and run it.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froialfassi%2Fpromptqueuerunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froialfassi%2Fpromptqueuerunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froialfassi%2Fpromptqueuerunner/lists"}