File size: 1,416 Bytes
e0d714c
b1434df
 
e0d714c
b1434df
 
 
e0d714c
b1434df
 
e0d714c
 
b1434df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
48
49
50
51
52
53
54
55
56
57
58
59
---
title: CodeLlama API Server
emoji: 🚀
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
license: apache-2.0
startup_duration_timeout: 1h
---

# CodeLlama API Server

OpenAI-compatible API server running CodeLlama 7B Instruct for code generation.

## Features

- OpenAI-compatible `/v1/chat/completions` endpoint
- OpenAI-compatible `/v1/completions` endpoint
- Simple `/generate` endpoint for quick testing
- No rate limiting - designed for unlimited usage
- Up to 4096 token context and responses
- CORS enabled for MCP server integration

## API Endpoints

### Chat Completions (Recommended)
```bash
curl -X POST https://truegleai-deepseek-coder-6b-api.hf.space/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "codellama-7b-instruct",
    "messages": [
      {"role": "user", "content": "Write a Python function to reverse a string"}
    ],
    "max_tokens": 512
  }'
```

### Simple Generation
```bash
curl -X POST https://truegleai-deepseek-coder-6b-api.hf.space/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a Python function to reverse a string",
    "max_tokens": 512
  }'
```

## MCP Server Integration

Use this Space as a backend for your MCP server by pointing it to:
```
https://truegleai-deepseek-coder-6b-api.hf.space
```

The API is OpenAI-compatible, so you can use it anywhere you'd use OpenAI's API.