{"id":26100539,"url":"https://github.com/beliavsky/groq-cpp-agent","last_synced_at":"2026-04-21T05:35:10.038Z","repository":{"id":281406857,"uuid":"945183045","full_name":"Beliavsky/Groq-cpp-agent","owner":"Beliavsky","description":"Python script that uses LLMs on Groq to create C++ programs, iterating with compiler error messages until they compile","archived":false,"fork":false,"pushed_at":"2025-03-08T22:06:19.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T22:18:34.672Z","etag":null,"topics":["cpp","groq","groq-api","llm","llm-coder"],"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/Beliavsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T21:05:09.000Z","updated_at":"2025-03-08T22:06:22.000Z","dependencies_parsed_at":"2025-03-08T22:18:45.091Z","dependency_job_id":null,"html_url":"https://github.com/Beliavsky/Groq-cpp-agent","commit_stats":null,"previous_names":["beliavsky/groq-cpp-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beliavsky%2FGroq-cpp-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beliavsky%2FGroq-cpp-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beliavsky%2FGroq-cpp-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beliavsky%2FGroq-cpp-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Beliavsky","download_url":"https://codeload.github.com/Beliavsky/Groq-cpp-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242729460,"owners_count":20175945,"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":["cpp","groq","groq-api","llm","llm-coder"],"created_at":"2025-03-09T17:39:20.142Z","updated_at":"2026-04-21T05:35:09.989Z","avatar_url":"https://github.com/Beliavsky.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Groq-cpp-agent\nPython script that uses LLMs on Groq to create C++ programs, iterating with compiler error messages until they compile\n\nSample output:\n```\nprompt:\nDo a C++ simulation to find the optimal trimmed mean estimator of\nthe location of the Cauchy distribution, trying trimming proportions\nof 0%, 10%, 20%, 30%, 40%, and 45%. Have the simulation use 100 samples of\n1000 observations each.\nOnly output C++ code. Do not give commentary.\n\nmodel: qwen-2.5-coder-32b\n\nCode compiled successfully after 1 attempt (generation time: 1.484 seconds, LOC=34)!\nRunning executable: .\\main.exe\n\nOutput:\n Trim: 0 Optimized Trimmed Mean: -0.459015\nTrim: 0.1 Optimized Trimmed Mean: 0.000221861\nTrim: 0.2 Optimized Trimmed Mean: -2.59736e-05\nTrim: 0.3 Optimized Trimmed Mean: 5.22513e-06\nTrim: 0.4 Optimized Trimmed Mean: 0.00341165\nTrim: 0.45 Optimized Trimmed Mean: -0.00236174\n\n\nTotal generation time: 1.484 seconds across 1 attempt\n\nCompilation command: g++ -o main main.cpp\n```\nThe code produced is\n```cpp\n// Generated from prompt file: prompt_cauchy.txt\n// Model used: qwen-2.5-coder-32b\n// Time generated: 2025-03-08 16:52:58\n// Generation time: 1.484 seconds\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n#include \u003calgorithm\u003e\n#include \u003ccmath\u003e\n#include \u003crandom\u003e\n\ndouble trimmedMean(std::vector\u003cdouble\u003e\u0026 data, double trim) {\n    std::sort(data.begin(), data.end());\n    int trimSize = std::floor(trim * data.size());\n    double sum = 0.0;\n    for (int i = trimSize; i \u003c data.size() - trimSize; ++i) {\n        sum += data[i];\n    }\n    return sum / (data.size() - 2 * trimSize);\n}\n\nint main() {\n    std::random_device rd;\n    std::mt19937 gen(rd());\n    std::cauchy_distribution\u003c\u003e dis(0.0, 1.0);\n\n    int numSamples = 100;\n    int sampleSize = 1000;\n    double trims[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.45};\n\n    for (double trim : trims) {\n        double totalTrimmedMean = 0.0;\n        for (int i = 0; i \u003c numSamples; ++i) {\n            std::vector\u003cdouble\u003e sample(sampleSize);\n            for (int j = 0; j \u003c sampleSize; ++j) {\n                sample[j] = dis(gen);\n            }\n            totalTrimmedMean += trimmedMean(sample, trim);\n        }\n        std::cout \u003c\u003c \"Trim: \" \u003c\u003c trim \u003c\u003c \" Optimized Trimmed Mean: \" \u003c\u003c totalTrimmedMean / numSamples \u003c\u003c std::endl;\n    }\n\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeliavsky%2Fgroq-cpp-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeliavsky%2Fgroq-cpp-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeliavsky%2Fgroq-cpp-agent/lists"}