Convert Declarative AI Recipes → Executable Infrastructure
This repo is an AI DevOps compiler that transforms YAML recipes into executable Jupyter notebooks, Docker configurations, and deployment manifests. It is NOT just a notebook generator.
CtxOS/cookbook/
│
├── cookbooks/ # Declarative recipes
│ ├── llm_finetune.yaml
│ ├── rag_pipeline.yaml
│ └── agent_builder.yaml
│
├── ctxcook/ # Core engine (Python package)
│ ├── __init__.py
│ ├── parser.py
│ ├── validator.py
│ ├── generator.py
│ ├── notebook.py
│ ├── exporter.py
│ └── cli.py
│
├── templates/
│ ├── colab_template.ipynb
│ ├── docker_template.j2
│ └── hf_deploy_template.j2
│
├── tests/
│ ├── test_parser.py
│ └── test_validator.py
│
├── pyproject.toml
├── README.md
└── Makefile
# Install locally
pip install -e .This makes the ctxcook CLI available globally.
# Build a notebook from a recipe
ctxcook build cookbooks/llm_finetune.yaml --output notebooks/finetune.ipynb
# Help
ctxcook --help
ctxcook build --helpname: llm_finetune_basic
model:
base: mistralai/Mistral-7B-v0.1
quantization: 4bit
dataset:
source: huggingface
name: secpatch/trainname: rag_pipeline_basic
model:
base: sentence-transformers/all-MiniLM-L6-v2
type: embedding
dataset:
source: local
path: ./documents
retrieval:
chunk_size: 512
overlap: 50name: agent_builder_basic
model:
base: gpt-3.5-turbo
provider: openai
tools:
- name: calculator
type: function
- name: web_search
type: api
agent:
type: conversational
memory: truepython -m pytest tests/black ctxcook/
flake8 ctxcook/- Add Jinja2 templating
- Add environment config (Colab / Docker / Local)
- Add version pinning
- DAG builder (convert recipe → pipeline graph)
- Add cost estimation
- Add GPU selection logic
- Integrate with CtxAI runtime
- Allow prompt → auto-generate cookbook YAML
- Add marketplace registry support
MIT License - see LICENSE file for details.