{"_id":"@coder-ka/ollama-as-webapi","_rev":"3-e81b4b9a7ea3dbfd5bf9e3b8e322fea4","name":"@coder-ka/ollama-as-webapi","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@coder-ka/ollama-as-webapi","version":"1.0.0","keywords":["ollama","ai","llm","webapi","cli"],"author":{"name":"Katsuyuki Oeda"},"license":"MIT","_id":"@coder-ka/ollama-as-webapi@1.0.0","maintainers":[{"name":"coder-ka","email":"coder.ka.issues@gmail.com"}],"homepage":"https://github.com/coder-ka/ollama-as-webapi#readme","bugs":{"url":"https://github.com/coder-ka/ollama-as-webapi/issues"},"bin":{"ollama-as-webapi":"dist/cli.js"},"dist":{"shasum":"01b6f2465bb166c454aff6da1d97f8363e2fd11a","tarball":"https://registry.npmjs.org/@coder-ka/ollama-as-webapi/-/ollama-as-webapi-1.0.0.tgz","fileCount":5,"integrity":"sha512-JRkYZrPlSyWvpuK12fW3dw5YgyToiaPoJ07D+K5RQ/kRRdIoKs4RC1AEKuqMgKvi8EouX7M4aHBAYDG9/yGKcQ==","signatures":[{"sig":"MEYCIQCuYooY+b4dXi8r0wZx7kwjf0gtshkTho+k06IsqLJjPAIhANOIFwD1iakOcWt/7dRH4x6j9A0TGQMFV7OgJma6sh0u","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6204},"type":"module","gitHead":"d9af67634deccf5e47b565ac6d08e2c5d061dd2a","scripts":{"dev":"tsx src/cli.ts","build":"tsc","start":"node dist/cli.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"coder-ka","email":"coder.ka.issues@gmail.com"},"repository":{"url":"git+https://github.com/coder-ka/ollama-as-webapi.git","type":"git"},"_npmVersion":"11.8.0","description":"This repository provides a simple CLI tool to serve Ollama models as a Web API.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"hono":"^4.12.0","ollama":"^0.6.3","commander":"^14.0.3","@hono/node-server":"^1.19.9"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","typescript":"^5.9.3","@types/node":"^25.3.0","@types/commander":"^2.12.0"},"_npmOperationalInternal":{"tmp":"tmp/ollama-as-webapi_1.0.0_1771510581001_0.6766288904845794","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@coder-ka/ollama-as-webapi","version":"1.0.1","keywords":["ollama","ai","llm","webapi","cli"],"author":{"name":"Katsuyuki Oeda"},"license":"MIT","_id":"@coder-ka/ollama-as-webapi@1.0.1","maintainers":[{"name":"coder-ka","email":"coder.ka.issues@gmail.com"}],"homepage":"https://github.com/coder-ka/ollama-as-webapi#readme","bugs":{"url":"https://github.com/coder-ka/ollama-as-webapi/issues"},"bin":{"ollama-as-webapi":"dist/cli.js"},"dist":{"shasum":"27d6ed296106abac6ee474c47466eef21fc6c87f","tarball":"https://registry.npmjs.org/@coder-ka/ollama-as-webapi/-/ollama-as-webapi-1.0.1.tgz","fileCount":5,"integrity":"sha512-yaxm/IgNOxH3IHwWZ75kVq3QlzYmbisewdDY3v+fa38fdgDy0qRWxiZCiAk27f+qm3FicI+1hzqeRYE+lAMEcw==","signatures":[{"sig":"MEQCIFwSVO4GTOYQzHXyHvQv+DXMcTt4PXBosU2pHIMRnDnEAiADfwAwlBpsbSzay3qRMxVcQykWysMHnGaFNakH08A9yg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6407},"type":"module","gitHead":"fdf2b7c12d629cb5a47b3d7c94d3f6d36ecc3c18","scripts":{"dev":"tsx src/cli.ts","build":"tsc","start":"node dist/cli.js","test:api":"tsx scripts/test-api.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"coder-ka","email":"coder.ka.issues@gmail.com"},"repository":{"url":"git+https://github.com/coder-ka/ollama-as-webapi.git","type":"git"},"_npmVersion":"11.8.0","description":"This repository provides a simple CLI tool to serve Ollama models as a Web API.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"hono":"^4.12.0","ollama":"^0.6.3","commander":"^14.0.3","@hono/node-server":"^1.19.9"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","typescript":"^5.9.3","@types/node":"^25.3.0","@types/commander":"^2.12.0"},"_npmOperationalInternal":{"tmp":"tmp/ollama-as-webapi_1.0.1_1771511434254_0.26410343874354547","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@coder-ka/ollama-as-webapi","version":"1.0.2","description":"This repository provides a simple CLI tool to serve Ollama models as a Web API.","type":"module","bin":{"ollama-as-webapi":"dist/cli.js"},"scripts":{"build":"esbuild src/cli.ts --bundle --platform=node --format=esm --outfile=dist/cli.js --banner:js=\"#!/usr/bin/env node\" --packages=external --minify","start":"node dist/cli.js","dev":"tsx src/cli.ts","prepublishOnly":"npm run build","test:api":"tsx scripts/test-api.ts"},"author":{"name":"Katsuyuki Oeda"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/coder-ka/ollama-as-webapi.git"},"bugs":{"url":"https://github.com/coder-ka/ollama-as-webapi/issues"},"homepage":"https://github.com/coder-ka/ollama-as-webapi#readme","keywords":["ollama","ai","llm","webapi","cli"],"dependencies":{"@hono/node-server":"^1.19.9","commander":"^14.0.3","hono":"^4.12.0","ollama":"^0.6.3"},"devDependencies":{"@types/commander":"^2.12.0","@types/node":"^25.3.0","esbuild":"^0.27.3","tsx":"^4.21.0","typescript":"^5.9.3"},"gitHead":"ab80cdfa6d4efa63b0267c913e5e8b9e0234cc99","_id":"@coder-ka/ollama-as-webapi@1.0.2","_nodeVersion":"22.15.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-t6wXaVumNcK0ymHomX5NVfjeN+2eyoyrqCP+2TRBErVc7iaUIljGrx07LVZUDcN0U8tAE6RMUFOH4eT9o609+w==","shasum":"f872c1cb4be7858afd4c7379a8799bbb00ce8cbc","tarball":"https://registry.npmjs.org/@coder-ka/ollama-as-webapi/-/ollama-as-webapi-1.0.2.tgz","fileCount":5,"unpackedSize":8351,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBDbOexbABQUEW1S/M5c3uRDEohNyA2winSFyP+MLFwYAiEAxnvUdL5X/ySoHTRbj/vLQk2r320O2DgcMOvsxLk6zcQ="}]},"_npmUser":{"name":"coder-ka","email":"coder.ka.issues@gmail.com"},"directories":{},"maintainers":[{"name":"coder-ka","email":"coder.ka.issues@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ollama-as-webapi_1.0.2_1771511952881_0.3980610811388987"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-19T14:16:20.858Z","modified":"2026-02-19T14:39:13.128Z","1.0.0":"2026-02-19T14:16:21.155Z","1.0.1":"2026-02-19T14:30:34.387Z","1.0.2":"2026-02-19T14:39:13.022Z"},"bugs":{"url":"https://github.com/coder-ka/ollama-as-webapi/issues"},"author":{"name":"Katsuyuki Oeda"},"license":"MIT","homepage":"https://github.com/coder-ka/ollama-as-webapi#readme","keywords":["ollama","ai","llm","webapi","cli"],"repository":{"type":"git","url":"git+https://github.com/coder-ka/ollama-as-webapi.git"},"description":"This repository provides a simple CLI tool to serve Ollama models as a Web API.","maintainers":[{"name":"coder-ka","email":"coder.ka.issues@gmail.com"}],"readme":"# ollama-as-webapi\r\n\r\nThis repository provides a simple CLI tool to serve Ollama models as a Web API.\r\n\r\n## Prerequisites\r\n\r\n- [Node.js](https://nodejs.org/) (v20 or higher recommended)\r\n- [Ollama](https://ollama.com/) installed and running\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm i -g @coder-ka/ollama-as-webapi\r\n```\r\n\r\n## Usage\r\n\r\n```bash\r\nollama-as-webapi\r\n```\r\n\r\n### CLI Options\r\n\r\n| Option | Description | Default |\r\n| --- | --- | --- |\r\n| `--model` | Model name | `gemma3:4b` |\r\n| `--port` | Port number | `3000` |\r\n| `--host` | Host name | `localhost` |\r\n| `--gpu` | Use GPU | `true` |\r\n\r\n## Web API Reference\r\n\r\n### Content Generation\r\n\r\n`/generate`\r\n\r\n#### Request Body\r\n\r\n| Field | Required | Type | Description | Default |\r\n| --- | --- | --- | --- | --- |\r\n| `prompt` | Yes | string | Prompt to generate content for | `\"\"` |\r\n| `maxTokens` | No | number | Maximum number of tokens to generate | `256` |\r\n| `temperature` | No | number | Temperature for sampling | `0.7` |\r\n| `topP` | No | number | Top-p sampling | `0.9` |\r\n| `topK` | No | number | Top-k sampling | `40` |\r\n| `n` | No | number | Number of samples to generate | `1` |\r\n| `stop` | No | string[] | Stop sequences | `[]` |\r\n\r\n#### Response Body\r\n\r\n| Field | Type | Description |\r\n| --- | --- | --- |\r\n| `text` | string | Generated content |\r\n| `tokens` | number | Number of tokens generated |\r\n| `finishReason` | string | Reason for finishing generation |\r\n\r\n#### Example\r\n\r\n```bash\r\ncurl -X POST http://localhost:3000/generate \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"prompt\": \"Hello\"}'\r\n```\r\n\r\n### License\r\n\r\nMIT\r\n\r\n### How to contribute\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Commit your changes\r\n4. Push to the branch\r\n5. Open a Pull Request\r\n\r\n### Author\r\n\r\n[Katsuyuki Oeda](https://github.com/coder-ka)\r\n","readmeFilename":"README.md"}