{"id":30100070,"url":"https://github.com/frontllm/frontllm-sdk","last_synced_at":"2025-09-05T00:36:23.715Z","repository":{"id":294087707,"uuid":"985958730","full_name":"frontllm/frontllm-sdk","owner":"frontllm","description":"FrontLLM is your public gateway to LLMs. Request LLM directly from your front-end code. No backend needed.","archived":false,"fork":false,"pushed_at":"2025-05-30T21:22:53.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T20:18:47.398Z","etag":null,"topics":["ai","gateway-api","llm","llm-framework","llm-gateway","openai"],"latest_commit_sha":null,"homepage":"https://frontllm.com/","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/frontllm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-05-18T21:46:10.000Z","updated_at":"2025-05-30T21:22:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0e5859b-626c-4586-bc5a-1e6a29848124","html_url":"https://github.com/frontllm/frontllm-sdk","commit_stats":null,"previous_names":["frontllm/frontllm-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/frontllm/frontllm-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontllm%2Ffrontllm-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontllm%2Ffrontllm-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontllm%2Ffrontllm-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontllm%2Ffrontllm-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frontllm","download_url":"https://codeload.github.com/frontllm/frontllm-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontllm%2Ffrontllm-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273695120,"owners_count":25151481,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"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":["ai","gateway-api","llm","llm-framework","llm-gateway","openai"],"created_at":"2025-08-09T15:28:14.595Z","updated_at":"2025-09-05T00:36:23.700Z","avatar_url":"https://github.com/frontllm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![FrontLLM](.github/cover.png)\n\n# FrontLLM\n\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ffrontllm%2Ffrontllm-sdk%2Fbadge%3Fref%3Dmain\u0026style=flat-square)](https://actions-badge.atrox.dev/frontllm/frontllm-sdk/goto?ref=main) [![License: MIT](https://img.shields.io/badge/license-MIT-green?style=flat-square)](/LICENSE) [![View this project on NPM](https://img.shields.io/npm/v/frontllm.svg?style=flat-square)](https://npmjs.org/package/frontllm)\n\nFrontLLM is your public gateway to LLMs. Request LLM directly from your front-end code. No backend needed.\n\n📝 Check the [documentation](https://frontllm.com/docs/introduction) for more details.\n\n### 👀 Demos\n\n* [Explain This](https://frontllm.com/docs/demos/explain-this)\n* [Streaming](https://frontllm.com/docs/demos/streaming)\n* [Translator](https://frontllm.com/docs/demos/translator)\n\n## 🚀 Installation\n\n### NPM\n\nTo use FrontLLM in your project, you can install it via npm:\n\n```bash\nnpm install frontllm\n```\n\nNow you can import the library and create an instance of the gateway with your specific gateway ID:\n\n```js\nimport { frontLLM } from 'frontllm';\nconst gateway = frontLLM('\u003cgateway_id\u003e');\n```\n\n### CDN\n\nTo use FrontLLM via CDN, you can include the following script tag in your HTML file:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/frontllm@0.1.3/dist/index.umd.js\"\u003e\u003c/script\u003e\n```\n\nThis will expose the `frontLLM` function globally, which you can use to create an instance of the gateway:\n\n```html\n\u003cscript\u003e\n  const gateway = frontLLM('\u003cgateway_id\u003e');\n  // ...\n\u003c/script\u003e\n```\n\n## 🎬 Usage\n\nChat Completion:\n\n```js\n// Short syntax - requires the default model configured in the gateway\n\nconst response = await gateway.complete('Hello world!'); \n\n// Full syntax\n\nconst response = await gateway.complete({\n  model: 'gpt-4',\n  messages: [\n    { role: 'user', content: 'Hello world!' }\n  ],\n  temperature: 0.7\n});\n\n// Output the generated response text to the console.\n\nconsole.log(response.choices[0].message.content);\n```\n\nChat Completion with Streaming:\n\n```js\n// Short syntax - requires the default model configured in the gateway\n\nconst response = await gateway.completeStreaming('Where is Europe?');\n\n// Full syntax\n\nconst response = await gateway.completeStreaming({\n  model: 'gpt-4',\n  messages: [\n    { role: 'user', content: 'Where is Europe?' }\n  ],\n  temperature: 0.7\n});\n\n// Output the generated response text to the console.\n\nfor (;;) {\n  const { finished, chunks } = await response.read();\n  for (const chunk of chunks) {\n    console.log(chunk.choices[0].delta.content);\n  }\n  if (finished) {\n    break;\n  }\n}\n```\n\n\n## 💡 License\n\nThis project is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontllm%2Ffrontllm-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrontllm%2Ffrontllm-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontllm%2Ffrontllm-sdk/lists"}