Spaces:
Sleeping
Sleeping
| title: ollama-code-embed | |
| emoji: 🧩 | |
| colorFrom: gray | |
| colorTo: indigo | |
| sdk: docker | |
| app_port: 11434 | |
| pinned: true | |
| # Ollama-Compatible Code Embeddings | |
| This Space exposes an Ollama-style embedding API backed by the same code embedding model used in `Code-Embed-Qwen-rerank-sentiment`. | |
| ## Model | |
| - Embeddings: `jinaai/jina-code-embeddings-0.5b` | |
| - Served model name: `code-embed` | |
| ## Endpoints | |
| - `GET /` | |
| - `GET /api/version` | |
| - `GET /api/tags` | |
| - `POST /api/embed` | |
| - `POST /api/embeddings` | |
| - `POST /embed` | |
| - `GET /health` | |
| ## Notes | |
| - The server accepts Ollama-style request bodies and ignores extra fields such as `api_key`. | |
| - `/api/embed` accepts `input` as either a string or a list of strings. | |
| - `/api/embeddings` is included for older Ollama clients that send a single `prompt`. | |
| ## Example | |
| ```bash | |
| curl -X POST "$SPACE_URL/api/embed" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "model": "code-embed", | |
| "input": ["def hello(name): return f\"Hello {name}\""], | |
| "truncate": true | |
| }' | |
| ``` | |