relay / README.md
ausername-12345
sync with sebebeb-relay.hf.space: fix API URL to /v1/chat/completions, add debug endpoint, restore OpenAI payload format
0a988dd
|
Raw
History Blame Contribute Delete
726 Bytes
---
title: InferencePort Relay
emoji: ๐Ÿ”
colorFrom: indigo
colorTo: purple
sdk: docker
pinned: false
---
# InferencePort Relay
FastAPI endpoint that accepts a system prompt + conversation history, trims to the last 3 message pairs, and forwards to InferencePort AI.
## Setup
Add a secret in your HF Space settings:
| Name | Value |
|------|-------|
| `INFERENCE_PORT_API_KEY` | your InferencePort API key |
## POST `/chat`
```json
{
"system": "your system prompt here",
"messages": [
{ "role": "user", "content": "hi" },
{ "role": "assistant", "content": "yo wsp" },
{ "role": "user", "content": "good hbu" }
]
}
```
Returns:
```json
{
"reply": "not bad lol",
"trimmed_message_count": 3
}
```