File size: 1,010 Bytes
39178c6
90582e1
 
 
 
39178c6
90582e1
 
39178c6
 
90582e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
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
  }'
```