{"id":14780147,"url":"https://github.com/xavidop/genkitx-github","last_synced_at":"2025-05-09T00:07:45.186Z","repository":{"id":255996103,"uuid":"853843195","full_name":"xavidop/genkitx-github","owner":"xavidop","description":"Community Plugin for Genkit to use Github Models","archived":false,"fork":false,"pushed_at":"2025-05-08T21:50:03.000Z","size":538,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T00:07:35.526Z","etag":null,"topics":["ai","ai21","ai21labs","cohere","firebase","gen-ai","generative-ai","genkit","genkit-plugin","genkitx","github","github-models","jais","lllama","meta","meta-llama","mistral","openai","plugin"],"latest_commit_sha":null,"homepage":"https://xavidop.github.io/genkitx-github/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xavidop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"xavidop","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-09-07T17:30:42.000Z","updated_at":"2025-05-08T21:50:05.000Z","dependencies_parsed_at":"2024-11-04T22:25:34.486Z","dependency_job_id":"cce06489-7035-42c3-9936-35219ab62a82","html_url":"https://github.com/xavidop/genkitx-github","commit_stats":{"total_commits":80,"total_committers":4,"mean_commits":20.0,"dds":0.5,"last_synced_commit":"24391901f6e3f63b2f0329a7f65894743650454a"},"previous_names":["xavidop/genkitx-github"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fgenkitx-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fgenkitx-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fgenkitx-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fgenkitx-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xavidop","download_url":"https://codeload.github.com/xavidop/genkitx-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166520,"owners_count":21864482,"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":["ai","ai21","ai21labs","cohere","firebase","gen-ai","generative-ai","genkit","genkit-plugin","genkitx","github","github-models","jais","lllama","meta","meta-llama","mistral","openai","plugin"],"created_at":"2024-09-17T01:01:08.452Z","updated_at":"2025-05-09T00:07:45.156Z","avatar_url":"https://github.com/xavidop.png","language":"TypeScript","readme":"![Firebase Genkit + GitHub Models](https://github.com/xavidop/genkitx-github/blob/main/assets/genkit-github.png?raw=true)\n\n\u003ch1 align=\"center\"\u003e\n   Firebase Genkit \u003c\u003e GitHub Models Plugin\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eGitHub Models Community Plugin for Google Firebase Genkit\u003c/h4\u003e\n\n\u003cdiv align=\"center\"\u003e\n   \u003cimg alt=\"GitHub version\" src=\"https://img.shields.io/github/v/release/xavidop/genkitx-github\"\u003e\n   \u003cimg alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dw/genkitx-github\"\u003e\n   \u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/xavidop/genkitx-github\"\u003e\n   \u003cimg alt=\"Static Badge\" src=\"https://img.shields.io/badge/yes-a?label=maintained\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n   \u003cimg alt=\"GitHub Issues or Pull Requests\" src=\"https://img.shields.io/github/issues/xavidop/genkitx-github?color=blue\"\u003e\n   \u003cimg alt=\"GitHub Issues or Pull Requests\" src=\"https://img.shields.io/github/issues-pr/xavidop/genkitx-github?color=blue\"\u003e\n   \u003cimg alt=\"GitHub commit activity\" src=\"https://img.shields.io/github/commit-activity/m/xavidop/genkitx-github\"\u003e\n\u003c/div\u003e\n\n\u003c/br\u003e\n\n**`genkitx-github`** is a community plugin for using GitHub Models APIs with\n[Firebase Genkit](https://github.com/firebase/genkit). Built by [**Xavier Portilla Edo**](https://github.com/xavidop).\n\nThis Genkit plugin allows to use GitHub models through their official APIs.\n\n## Installation\n\nInstall the plugin in your project with your favorite package manager:\n\n- `npm install genkitx-github`\n- `pnpm add genkitx-github`\n\n### Versions\n\nif you are using Genkit version `\u003cv0.9.0`, please use the plugin version `v1.9.0`. If you are using Genkit `\u003e=v0.9.0`, please use the plugin version `\u003e=v1.10.0`.\n\n## Usage\n\n### Configuration\n\nTo use the plugin, you need to configure it with your GitHub Token key. You can do this by calling the `genkit` function:\n\n```typescript\nimport { genkit, z } from 'genkit';\nimport {github, openAIGpt4o} from \"genkitx-github\";\n\nconst ai = genkit({\n  plugins: [\n    github({\n      githubToken: '\u003cmy-github-token\u003e',\n    }),\n    model: openAIGpt4o,\n  ]\n});\n```\n\nYou can also intialize the plugin in this way if you have set the `GITHUB_TOKEN` environment variable:\n\n```typescript\nimport { genkit, z } from 'genkit';\nimport {github, openAIGpt4o} from \"genkitx-github\";\n\nconst ai = genkit({\n  plugins: [\n    github({\n      githubToken: '\u003cmy-github-token\u003e',\n    }),\n    model: openAIGpt4o,\n  ]\n});\n```\n\n### Basic examples\n\nThe simplest way to call the text generation model is by using the helper function `generate`:\n\n```typescript\nimport { genkit, z } from 'genkit';\nimport {github, openAIGpt4o} from \"genkitx-github\";\n\n// Basic usage of an LLM\nconst response = await ai.generate({\n  prompt: 'Tell me a joke.',\n});\n\nconsole.log(await response.text);\n```\n\n### Within a flow\n\n```typescript\n// ...configure Genkit (as shown above)...\n\nexport const myFlow = ai.defineFlow(\n  {\n    name: 'menuSuggestionFlow',\n    inputSchema: z.string(),\n    outputSchema: z.string(),\n  },\n  async (subject) =\u003e {\n    const llmResponse = await ai.generate({\n      prompt: `Suggest an item for the menu of a ${subject} themed restaurant`,\n    });\n\n    return llmResponse.text;\n  }\n);\n```\n\n### Tool use\n\n```typescript\n// ...configure Genkit (as shown above)...\n\nconst specialToolInputSchema = z.object({ meal: z.enum([\"breakfast\", \"lunch\", \"dinner\"]) });\nconst specialTool = ai.defineTool(\n  {\n    name: \"specialTool\",\n    description: \"Retrieves today's special for the given meal\",\n    inputSchema: specialToolInputSchema,\n    outputSchema: z.string(),\n  },\n  async ({ meal }): Promise\u003cstring\u003e =\u003e {\n    // Retrieve up-to-date information and return it. Here, we just return a\n    // fixed value.\n    return \"Baked beans on toast\";\n  }\n);\n\nconst result = ai.generate({\n  tools: [specialTool],\n  prompt: \"What's for breakfast?\",\n});\n\nconsole.log(result.then((res) =\u003e res.text));\n```\n\nFor more detailed examples and the explanation of other functionalities, refer to the [official Genkit documentation](https://firebase.google.com/docs/genkit/get-started).\n\n## Supported models\n\nThis plugin supports all currently available **Chat/Completion** and **Embeddings** models from GitHub Models. This plugin supports image input and multimodal models.\n\n## API Reference\n\nYou can find the full API reference in the [API Reference Documentation](https://xavidop.github.io/genkitx-github/)\n\n## Troubleshooting\n\n1. GPT `o1-preview`, `o1` and `o1-mini` it is still in beta. It does not support system roles, tools and the `temperature` and `topP` needs to be set to `1`. See OpenAI annocement [here](https://openai.com/index/introducing-openai-o1-preview/)\n2. Cohere models only supports text output for now. Issue opened [here](https://github.com/orgs/community/discussions/142364).\n\n## Contributing\n\nWant to contribute to the project? That's awesome! Head over to our [Contribution Guidelines](https://github.com/xavidop/genkitx-github/blob/main/CONTRIBUTING.md).\n\n## Need support?\n\n\u003e [!NOTE]  \n\u003e This repository depends on Google's Firebase Genkit. For issues and questions related to Genkit, please refer to instructions available in [Genkit's repository](https://github.com/firebase/genkit).\n\nReach out by opening a discussion on [GitHub Discussions](https://github.com/xavidop/genkitx-github/discussions).\n\n## Credits\n\nThis plugin is proudly maintained by Xavier Portilla Edo [**Xavier Portilla Edo**](https://github.com/xavidop).\n\nI got the inspiration, structure and patterns to create this plugin from the [Genkit Community Plugins](https://github.com/TheFireCo/genkit-plugins) repository built by the [Fire Compnay](https://github.com/TheFireCo) as well as the [ollama plugin](https://firebase.google.com/docs/genkit/plugins/ollama).\n\n## License\n\nThis project is licensed under the [Apache 2.0 License](https://github.com/xavidop/genkitx-github/blob/main/LICENSE).\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202%2E0-lightgrey.svg)](https://github.com/xavidop/genkitx-github/blob/main/LICENSE)\n","funding_links":["https://github.com/sponsors/xavidop"],"categories":["Plugins","Recently Updated"],"sub_categories":["JavaScript - Community","[Sep 15, 2024](/content/2024/09/15/README.md)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavidop%2Fgenkitx-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxavidop%2Fgenkitx-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavidop%2Fgenkitx-github/lists"}