{"id":14964775,"url":"https://github.com/thekevinscott/contortionist","last_synced_at":"2026-02-11T10:32:53.737Z","repository":{"id":229353302,"uuid":"774384441","full_name":"thekevinscott/Contortionist","owner":"thekevinscott","description":"Control what LLMs can, and can't, say","archived":false,"fork":false,"pushed_at":"2024-04-13T20:00:26.000Z","size":875,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T01:13:00.590Z","etag":null,"topics":["gbnf","llamacpp","llamafile","llm","transformersjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/thekevinscott.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}},"created_at":"2024-03-19T13:08:37.000Z","updated_at":"2024-04-15T10:54:15.969Z","dependencies_parsed_at":"2024-04-15T11:10:29.157Z","dependency_job_id":null,"html_url":"https://github.com/thekevinscott/Contortionist","commit_stats":null,"previous_names":["thekevinscott/contortionist"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekevinscott%2FContortionist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekevinscott%2FContortionist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekevinscott%2FContortionist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekevinscott%2FContortionist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thekevinscott","download_url":"https://codeload.github.com/thekevinscott/Contortionist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247886592,"owners_count":21012868,"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":["gbnf","llamacpp","llamafile","llm","transformersjs"],"created_at":"2024-09-24T13:33:45.810Z","updated_at":"2025-04-08T16:43:27.211Z","avatar_url":"https://github.com/thekevinscott.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contortionist\n\n\u003ca href=\"https://www.npmjs.com/package/contort\"\u003e\u003cimg alt=\"Latest Contortionist NPM Version\" src=\"https://badge.fury.io/js/contort.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/thekevinscott/contortionist/blob/master/LICENSE\"\u003e\u003cimg alt=\"License for contortionist\" src=\"https://img.shields.io/npm/l/contortionist\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/cnotort\"\u003e\u003cimg alt=\"Downloads per week on NPM for contortionist\" src=\"https://img.shields.io/npm/dw/contort\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/thekevinscott/contortionist/actions/workflows/tests.yaml\"\u003e\u003cimg src=\"https://github.com/thekevinscott/contortionist/actions/workflows/tests.yaml/badge.svg\" alt=\"Status of tests for contortionist repository\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/thekevinscott/contortionist\"\u003e\u003cimg alt=\"Code Coverage for contortionist\" src=\"https://img.shields.io/codecov/c/github/thekevinscott/contortionist\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://deepsource.io/gh/thekevinscott/contortionist/?ref=repository-badge\"\u003e\u003cimg alt=\"DeepSource issues for contortionist\" src=\"https://deepsource.io/gh/thekevinscott/contortionist.svg/?label=active+issues\u0026show_trend=true\" /\u003e\u003c/a\u003e\n\n![alt text](./packages/contort/assets/eye.webp)\n\nControl what LLMs can, and can't, say.\n\n## Install\n\n```bash\nnpm install contortionist\n```\n\n## Usage\n\n```javascript\nimport Contortionist from 'contortionist';\nconst grammar = 'root ::= \"foo\"';\nconst contortionist = new Contortionist({\n  grammar,\n  model: {\n    protocol: 'llama.cpp',\n    endpoint: 'http://localhost:4445',\n  },\n});\n\nconst result = await contortionist.execute(prompt, {\n  n: 40,\n  stream: true,\n  callback: ({ partial }) =\u003e {\n    output.textContent = partial;\n  }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekevinscott%2Fcontortionist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekevinscott%2Fcontortionist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekevinscott%2Fcontortionist/lists"}