{"_id":"2ollama","_rev":"3-06bccb2cddc8e3d916af436c46249a97","name":"2ollama","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"2ollama","version":"1.0.0","keywords":["ollama","codestral","openai","proxy","llm","code-completion","fim","zed"],"author":"","license":"MIT","_id":"2ollama@1.0.0","maintainers":[{"name":"teimurjan","email":"teymurgg321@gmail.com"}],"homepage":"https://github.com/user/2ollama#readme","bugs":{"url":"https://github.com/user/2ollama/issues"},"bin":{"2ollama":"dist/cli.js"},"dist":{"shasum":"3502d55a7b39bbc481e4a1184f8c315fa5b3fb5d","tarball":"https://registry.npmjs.org/2ollama/-/2ollama-1.0.0.tgz","fileCount":8,"integrity":"sha512-Vxhmb2y0Y9ml5UiYrLwdZekc1N05JRIQQlMhuJEmyGOa2mxYcbacHt2XmQORMzCjCcv+Hq7mZwHoIWul3LZopQ==","signatures":[{"sig":"MEQCIGSJ7g2ld5Pq3ntMsfVHqzTWfinTipCfSCWJ5bl2uyouAiBhhx0Ey4qvCwGQwVB1IRUubc4Xs9nDmgjSMcKYu6ZaOg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17930},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"c2b162d63db24e7be1789be23b2739836af1f1ad","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint","build":"tsup","check":"biome check --write","start":"bun run src/index.ts","format":"biome format --write","typecheck":"tsc","prepublishOnly":"bun run build"},"_npmUser":{"name":"teimurjan","email":"teymurgg321@gmail.com"},"repository":{"url":"git+https://github.com/user/2ollama.git","type":"git"},"_npmVersion":"10.8.2","description":"Proxy server that translates various LLM API formats (Codestral, OpenAI, etc.) to Ollama","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8","@types/bun":"latest","typescript":"^5.9.3","@types/node":"^22","@biomejs/biome":"^2.3.13"},"_npmOperationalInternal":{"tmp":"tmp/2ollama_1.0.0_1770023327312_0.16078280463403116","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"2ollama","version":"1.0.1","keywords":["ollama","codestral","openai","proxy","llm","code-completion","fim","zed"],"author":{"url":"https://github.com/teimurjan","name":"Teimur Gasanov","email":"me@teimurjan.dev"},"license":"MIT","_id":"2ollama@1.0.1","maintainers":[{"name":"teimurjan","email":"teymurgg321@gmail.com"}],"homepage":"https://github.com/teimurjan/2ollama#readme","bugs":{"url":"https://github.com/teimurjan/2ollama/issues"},"bin":{"2ollama":"dist/cli.js"},"dist":{"shasum":"f91fcff13091d4362ca371ac0e74b149278efc7d","tarball":"https://registry.npmjs.org/2ollama/-/2ollama-1.0.1.tgz","fileCount":8,"integrity":"sha512-mWlT9/Urb1m2VYlSopUOdlgigbsujKWtd6TE8wrboU+RjQ0GskzBBh6jmBQ/+qTWsYGH2VhAYpSFNYkH02AyAw==","signatures":[{"sig":"MEYCIQDarQbXx3GvMlv3k9UVL/+L3/ZazYm0vWV1ZnWxCf4BQgIhAPN3Lxr+YLdfFsvZtQoEx/dDei0eJ/sEFRK7cWKXiSju","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17932},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"cc02ba8dc0103f1882452cb8edfc5f27d64c2ad5","scripts":{"dev":"bun run --watch src/index.ts","lint":"biome lint","build":"tsup","check":"biome check --write","start":"bun run src/index.ts","format":"biome format --write","typecheck":"tsc","prepublishOnly":"bun run build"},"_npmUser":{"name":"teimurjan","email":"teymurgg321@gmail.com"},"repository":{"url":"git+https://github.com/teimurjan/2ollama.git","type":"git"},"_npmVersion":"10.8.2","description":"Proxy server that translates various LLM API formats (Codestral, OpenAI, etc.) to Ollama","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8","@types/bun":"latest","typescript":"^5.9.3","@types/node":"^22","@biomejs/biome":"^2.3.13"},"_npmOperationalInternal":{"tmp":"tmp/2ollama_1.0.1_1770023911277_0.7585056234149072","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"2ollama","version":"1.0.2","description":"Proxy server that translates various LLM API formats (Codestral, OpenAI, etc.) to Ollama","type":"module","bin":{"2ollama":"dist/cli.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"dev":"bun run --watch src/cli.ts","start":"bun run src/cli.ts","build":"tsup","check":"biome check --write","lint":"biome lint","format":"biome format --write","typecheck":"tsc","prepublishOnly":"bun run build"},"keywords":["ollama","codestral","openai","proxy","llm","code-completion","fim","zed"],"author":{"name":"Teimur Gasanov","email":"me@teimurjan.dev","url":"https://github.com/teimurjan"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/teimurjan/2ollama.git"},"engines":{"node":">=18"},"devDependencies":{"@biomejs/biome":"^2.3.13","@types/bun":"latest","@types/node":"^22","tsup":"^8","typescript":"^5.9.3"},"_id":"2ollama@1.0.2","gitHead":"03631a621ce0001c79a8fafd9355f6171cf13fa9","bugs":{"url":"https://github.com/teimurjan/2ollama/issues"},"homepage":"https://github.com/teimurjan/2ollama#readme","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-OVpzf4py1LnZp1Yw7LuXJSk6le/zjKWS1GbfkTRm5ihz4Z8BdY22khsLdzDEmy0B94NY/zqr4u3jb/dFuci4nQ==","shasum":"1e82b1d80ab5cbe58c6d379b2624111748f90549","tarball":"https://registry.npmjs.org/2ollama/-/2ollama-1.0.2.tgz","fileCount":8,"unpackedSize":19593,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCNexloxfyuQWLo4Ebxernzi2PhAZMjKbsbjMVOh8CxZwIgQ3hRDVzmt3aN9dZEdrGLp5Q9h4Q5b2tVEVeb2ZAJfP8="}]},"_npmUser":{"name":"teimurjan","email":"teymurgg321@gmail.com"},"directories":{},"maintainers":[{"name":"teimurjan","email":"teymurgg321@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/2ollama_1.0.2_1770029895791_0.9686134211030049"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-02T09:08:47.231Z","modified":"2026-02-02T10:58:16.033Z","1.0.0":"2026-02-02T09:08:47.442Z","1.0.1":"2026-02-02T09:18:31.418Z","1.0.2":"2026-02-02T10:58:15.920Z"},"bugs":{"url":"https://github.com/teimurjan/2ollama/issues"},"author":{"name":"Teimur Gasanov","email":"me@teimurjan.dev","url":"https://github.com/teimurjan"},"license":"MIT","homepage":"https://github.com/teimurjan/2ollama#readme","keywords":["ollama","codestral","openai","proxy","llm","code-completion","fim","zed"],"repository":{"type":"git","url":"git+https://github.com/teimurjan/2ollama.git"},"description":"Proxy server that translates various LLM API formats (Codestral, OpenAI, etc.) to Ollama","maintainers":[{"name":"teimurjan","email":"teymurgg321@gmail.com"}],"readme":"# 2ollama\n\nProxy server that translates various LLM API formats to [Ollama](https://ollama.com).\n\n**Use case:** Run local LLM completions with tools that only support cloud APIs (like [Zed](https://zed.dev) editor's Codestral integration).\n\n## Supported Providers\n\n| Provider | Endpoints | Status |\n|----------|-----------|--------|\n| Codestral | `/v1/fim/completions`, `/v1/models` | ✅ |\n| OpenAI | `/v1/chat/completions` | 🔜 Planned |\n| Anthropic | `/v1/messages` | 🔜 Planned |\n\n## Installation\n\n```bash\nnpm install -g 2ollama\n```\n\nOr run directly with npx:\n\n```bash\nnpx 2ollama\n```\n\n## Usage\n\n### Start the proxy\n\n```bash\n2ollama\n```\n\n### Options\n\n```\n-p, --port <PORT>          Port to listen on (default: 8787)\n-o, --ollama-url <URL>     Ollama server URL (default: http://localhost:11434)\n-m, --model <MODEL>        Default model to use (default: codestral:latest)\n-d, --daemon               Run in background\n-h, --help                 Show help\n-v, --version              Show version\n```\n\n### Environment variables\n\n```bash\nPORT=8787\nOLLAMA_URL=http://localhost:11434\nDEFAULT_MODEL=codestral:latest\n```\n\n### Examples\n\n```bash\n# Use a different model\n2ollama --model qwen2.5-coder:7b\n\n# Run on a different port\n2ollama --port 8080\n\n# Run in background\n2ollama --daemon\n\n# Connect to remote Ollama\n2ollama --ollama-url http://192.168.1.100:11434\n```\n\n## Zed Configuration (Codestral)\n\n1. Start the proxy: `2ollama`\n\n2. Configure Zed's `settings.json`:\n\n```json\n{\n  \"language_models\": {\n    \"codestral\": {\n      \"api_url\": \"http://localhost:8787\"\n    }\n  },\n  \"features\": {\n    \"edit_prediction_provider\": \"codestral\"\n  }\n}\n```\n\n3. Enter any string as the API key when prompted (it's ignored by the proxy)\n\n## Recommended Models\n\nAny Ollama model with FIM (fill-in-middle) support works. For instance:\n\n- `codestral:latest` - Mistral's code model (22B, best quality)\n- `qwen2.5-coder:7b` - Good balance of speed and quality\n- `qwen2.5-coder:1.5b` - Fast, lower resource usage\n- `deepseek-coder-v2:16b` - Strong coding performance\n- `starcoder2:7b` - Solid alternative\n\nPull your preferred model:\n\n```bash\nollama pull qwen2.5-coder:7b\n```\n\n## API Endpoints\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/` | GET | Health check |\n| `/health` | GET | Health check |\n| `/v1/fim/completions` | POST | FIM completions (Codestral format) |\n| `/v1/models` | GET | List available models |\n\n## Programmatic Usage\n\n```typescript\nimport { startServer } from \"2ollama\";\n\nstartServer({\n  port: 8787,\n  ollamaUrl: \"http://localhost:11434\",\n  defaultModel: \"codestral:latest\",\n});\n```\n\n## Architecture\n\n2ollama uses a pluggable provider system. Each provider defines routes that translate incoming API requests to Ollama's format.\n\n```\nsrc/\n  provider.ts           # Provider interface\n  providers/\n    index.ts            # Provider registry\n    codestral/          # Codestral provider\n      index.ts          # Route handlers\n      types.ts          # Request/Response types\n      transform.ts      # Format transformations\n```\n\n### Adding a Provider\n\n```typescript\nimport type { Provider } from \"2ollama\";\n\nexport const myProvider: Provider = {\n  name: \"my-provider\",\n  routes: [\n    {\n      method: \"POST\",\n      path: \"/v1/my/endpoint\",\n      handler: async (req, res, ctx) => {\n        // Transform request, call Ollama, return response\n      },\n    },\n  ],\n};\n```\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run in development mode\nbun run dev\n\n# Build\nbun run build\n\n# Type check\nbun run typecheck\n\n# Lint/format\nbun run check\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}