{"id":45761774,"url":"https://github.com/marcosjimenez/pcompiler","last_synced_at":"2026-03-12T05:05:59.634Z","repository":{"id":340228175,"uuid":"1164323149","full_name":"marcosjimenez/pCompiler","owner":"marcosjimenez","description":"A declarative prompt engineering framework that transforms high-level DSL definitions into optimized, model-specific LLM prompts.","archived":false,"fork":false,"pushed_at":"2026-02-27T02:58:59.000Z","size":109,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-27T03:58:03.760Z","etag":null,"topics":["cicd","context-engineering","prompt-engineering","python","tools"],"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/marcosjimenez.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-23T00:09:33.000Z","updated_at":"2026-02-27T02:59:03.000Z","dependencies_parsed_at":"2026-03-01T02:00:40.562Z","dependency_job_id":null,"html_url":"https://github.com/marcosjimenez/pCompiler","commit_stats":null,"previous_names":["marcosjimenez/pcompiler"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/marcosjimenez/pCompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosjimenez%2FpCompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosjimenez%2FpCompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosjimenez%2FpCompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosjimenez%2FpCompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcosjimenez","download_url":"https://codeload.github.com/marcosjimenez/pCompiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosjimenez%2FpCompiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29958378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cicd","context-engineering","prompt-engineering","python","tools"],"created_at":"2026-02-25T23:17:42.241Z","updated_at":"2026-03-12T05:05:59.602Z","avatar_url":"https://github.com/marcosjimenez.png","language":"Python","readme":"# pCompiler\n\n[![Python](https://img.shields.io/badge/python-3.11+-green.svg)](pyproject.toml)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)\n\n**pCompiler** is a declarative prompt engineering framework that transforms high-level DSL definitions into optimized, model-specific LLM prompts. It bridges the gap between raw text prompting and structured, versioned, and secure prompt management.\n\n---\n\n## 🌟 What the project does\n\npCompiler allows developers to treat prompts as code. By defining prompts in a structured YAML Domain Specific Language (DSL), you can:\n\n- **Generate** starting specifications from natural language descriptions.\n- **Advanced Templating**: Support for Jinja2 in user input templates (loops, conditionals).\n- **Validate** prompts for ambiguities, contradictions, and security risks.\n- **Optimize** content for specific LLM backends (OpenAI, Anthropic, Gemini).\n- **Estimate Costs** before execution with real-time pricing and latency analytics.\n- **Automate** quality control with built-in evaluation suites.\n- **Deploy** versioned, reproducible prompt payloads to your applications.\n\n## ✨ Why pCompiler?\n\nIn a world where LLM prompts are increasingly complex and critical to application logic, pCompiler provides the tools to make them robust:\n\n- **Type Safety \u0026 Validation**: Uses Pydantic to ensure your specifications are always valid.\n- **Smart Optimization**: Automatically applies semantic compression, Chain-of-Thought policies, and section reordering tailored to each model's strengths.\n- **Security by Design**: Native protection against prompt injection and system prompt leakage.\n- **Collaborative Engineering**: Versioned YAML files make it easy for teams to track changes and collaborate via Git.\n- **RAG Ready**: Built-in support for multiple context sources, including local files, vector stores, and web search.\n\n## 🚀 How to get started\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/marcosjimenez/pCompiler.git\ncd pCompiler\n\n# Install in editable mode with dev dependencies\npip install -e \".[dev]\"\n```\n\n### Quick Start\n\n1. **Auto-generate a DSL spec:**\n   ```bash\n   pcompile create \"Summarize a medical report focusing on patient history.\" --output medical.yaml\n   ```\n\n2. **Refine your DSL specification (`medical.yaml`):**\n   ```yaml\n   task: summarize\n   model_target: gpt-4o\n   constraints:\n     tone: professional\n     cot_policy: auto\n   instructions:\n     - text: \"Highlight patient history and active medications.\"\n       priority: 100\n   ```\n\n3. **Compile to a model-ready payload:**\n   ```bash\n   pcompile compile medical.yaml --target gpt-4o\n   ```\n\n4. **Run automated evaluations:**\n   ```bash\n   pcompile eval medical.yaml --mock\n   ```\n\n## 📖 Where to get help\n\n- [**DSL Reference**](docs/dsl.md): Detailed documentation of the YAML schema and attributes.\n- [**Advanced Templating**](docs/dsl.md#advanced-templating-jinja2): Using Jinja2 for loops, conditionals, and complex logic.\n- [**CLI Guide**](docs/cli.md): Full list of commands and options.\n- [**Cost \u0026 Latency Estimator**](docs/cost_estimation.md): How to estimate prompt costs before execution and manage pricing data.\n- [**Auto-Evals System**](docs/evals.md): How to build and run automated prompt quality tests.\n- [**Context Engineering**](docs/dsl.md#context): Strategies for RAG and dynamic background information.\n- [**Integrated CI/CD**](docs/cicd.md): Automating validation and testing in your pipeline.\n- [**Packaging**](docs/packaging.md): How to build and distribute pCompiler on your own registry.\n- [**Plugin System**](docs/plugins.md): Guide on how to use, write and manage backend plugins and their associated models.\n\n## 👥 Who maintains \u0026 contributes\n\n### Maintainer\n- **Marcos Jiménez** - [GitHub Profile](https://github.com/marcosjimenez)\n\n### Contributing\nWe welcome contributions! Please feel free to open an issue or pull request to suggest improvements or report bugs.\n\n---\n\n*pCompiler — Optimize your prompts, automate your evaluations.*","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcosjimenez%2Fpcompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcosjimenez%2Fpcompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcosjimenez%2Fpcompiler/lists"}