{"id":14985581,"url":"https://github.com/ncrmro/yams","last_synced_at":"2025-09-12T02:15:57.392Z","repository":{"id":246215734,"uuid":"820181675","full_name":"ncrmro/yams","owner":"ncrmro","description":"Yams are LLM chat histories declared as yaml (with markdown strings).","archived":false,"fork":false,"pushed_at":"2024-07-26T21:50:27.000Z","size":35,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T15:54:28.693Z","etag":null,"topics":["bash","low-code","ollama","shell","yaml"],"latest_commit_sha":null,"homepage":"https://yams.fyi","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncrmro.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-06-26T01:08:03.000Z","updated_at":"2024-07-26T21:50:30.000Z","dependencies_parsed_at":"2024-07-26T23:02:38.180Z","dependency_job_id":"1c24217c-1718-4c18-a69e-30492a0c8896","html_url":"https://github.com/ncrmro/yams","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"ea3cdc96e27b08d7b78e8e4d7329551bd73ff378"},"previous_names":["ncrmro/yams"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fyams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fyams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fyams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fyams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncrmro","download_url":"https://codeload.github.com/ncrmro/yams/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487710,"owners_count":21112188,"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":["bash","low-code","ollama","shell","yaml"],"created_at":"2024-09-24T14:11:14.586Z","updated_at":"2025-04-11T22:00:27.841Z","avatar_url":"https://github.com/ncrmro.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YAMs\n\nYAMs are chat histories with LLMs declared as YAML, containing markdown strings used primarily to communicate with an Ollama API and aid in ideation or in agentic workflows.\n\n**Advantages**:\n\n- Extremely low-code with high developer ergonomics and inspectability.\n- Provide an example workflow for developing LLM prompts involving structured data input and outputs.\n- commiting and collaborating of chat's to VCS allows for rapid ideation\n\n**Example YAM**\n\nGenerally a VCS Git repo might hav a `docs` or `documentation` folder, we can then create `docs/yams/000-template.yaml` and use that to jumpstart any new YAMs before commiting them. \nThis allows YAMs to be further refined with peers in pull reqiests.\n\nHere we might have a folder of `recipies` and the following YAM might be `recipies/001-penut-butter-and-jelly.yaml`\n\n````yaml\n# YAMs context doc\n# - everything in this file gets converted to JSON and sent to an Ollama LLM endpoint\n# - single prompt with a context block provided as a markdown yaml codeblock\n# - returns either the context block back a yaml, markdown or plain text\n\nmodel: mistral\nmessages:\n  - role: user\n    content: \u003e-\n      Using the following context:\n\n      ```yaml \n      type: recipe\n      slug: \"\"\n      title: \"Peanut butter and jelly\"\n      ingredients:\n        - name: Crunchy Peanut Butter\n          quantity: 2\n          unit: Tbsp\n      steps:\n        - Spread Peanut Butter on bread.\n      ```\n\n      Complete the document in the YAML code block.\n\n      ```yaml\n\n      ```\n\n  # After we run bin/yams ./pbj.yaml\n  # The following object will be added from the LLM's response\n\n  - role: assistant\n    content: |2-\n       ```yaml\n      type: recipe\n      slug: \"peanut-butter-and-jelly\"\n      title: \"Peanut Butter and Jelly Sandwich\"\n      ingredients:\n        - name: Crunchy Peanut Butter\n          quantity: 2\n          unit: Tbsp\n        - name: Smooth Jelly or Jam (Strawberry, Grape, etc.)\n          quantity: 3\n          unit: Tbsp\n      steps:\n        - Spread a layer of Peanut Butter on one slice of bread.\n        - Spread a layer of Jelly or Jam on another slice of bread.\n        - Place the two slices together with their respective layers facing each other.\n      ```\n````\n\n\n**Whats in this Repo?**\n\n- [bin/yams](bin/yams)\n  - Copy and customize this in your repos!\n  - Use TODOs and an LLM to make quick modifictions to `bin/yams` if required (or re-implment and link to that here)\n- [examples/recipes/peanut-butter-and-jelly.yaml](examples/recipes/peanut-butter-and-jelly.yaml)\n  - committed after running the `bin/yams` script.\n- New Prompt skeleton prompts are easy to generate by asking an LLM\n  - Example: How would you define `x` as yaml  (do note less is more on templates)\n    - [screenplay](https://chatgpt.com/share/9c4626d9-2603-4bd5-80b3-582d41137ec2)\n    - [recipe](https://chatgpt.com/share/76eead06-8b3d-425e-96bd-e35a9938faf6)\n    - [business plan](https://chatgpt.com/share/0f698383-0146-4862-9816-b6e12f1f1fe9)\n\n**Process**:\n\n\n- The chat history request body is specified as a YAML file.\n  - Model is set as a top-level key in the YAMs with parameters from the [Ollama API](https://github.com/ollama/ollama/blob/main/docs/api.md).\n- YAML markdown codeblocks are used to pass structured data into an LLM prompt.\n- Outputs are requested can be YAML markdown codeblocks or other structured and extracted for further processing\n\n**Implementation Notes**:\n\n- Located in `bin/yams`.\n- Structured examples provide desired context for minimal YAML input.\n- YAML is preferred for its natural language similarity and large corpus.\n- Suitable for declarative LLM chats on private or public APIs.\n\n# TODOs\n\n- [ ] Content key could be yaml directly rather than a markdown codeblock\n- [ ] Provide notes on using hosted Ollama endpoints.\n- [ ] Address YAML reformatting issues in initial message prompts.\n- [ ] Improve templating.\n- [ ] Rerun on file changes (with original prompt?)\n- [ ] Stream results directly from curl responses into YAML for impact.\n\n# Naive Shell Implementation Example\n\nThis is a basic implementation of YAMs to complete a document generating a peanut butter and jelly recipe. We can complete\nit by running `bin/yams examples/recipes/peanut-butter-and-jelly.yaml` which will send this request to the specified Ollama API endpoint for completion.\n\nInside of `examples/screenplays/cyberpunk-spirited-away.yaml` is a starter YAMs I generated from this [prompt](https://chatgpt.com/c/3f21cf03-c65a-42b6-a705-b8a3ef368ddb) to declare a screenplay as yaml. On\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrmro%2Fyams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncrmro%2Fyams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrmro%2Fyams/lists"}