File size: 2,694 Bytes
8131ac3
 
 
 
 
 
0fb809c
8131ac3
 
 
 
736b42c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: Openwebui Anthropic
emoji: πŸ“Š
colorFrom: blue
colorTo: gray
sdk: docker
app_port: 9099
pinned: false
short_description: Pipeline backend for using Claude model
---


# OpenWebUI Anthropic Integration πŸ€–

This space provides a backend service to use Anthropic's Claude models with OpenWebUI. It acts as an API compatibility layer between OpenWebUI and Anthropic's API.

## πŸ“‹ Overview

This service allows you to use Claude models in OpenWebUI by providing an OpenAI-compatible API endpoint. It supports all Claude 3 models:
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-3-haiku-20240307
- claude-3-5-sonnet-20241022

## πŸš€ Getting Started

### 1. Get Your Anthropic API Key
First, you'll need an Anthropic API key. You can get one from [Anthropic's website](https://console.anthropic.com/).

### 2. Configure OpenWebUI

In OpenWebUI's settings, add a new API endpoint with the following configuration:

1. Go to "Parameters" > "API compatibles OpenAI"
2. Set the API endpoint URL to:
```
https://cotcotquedec-openwebui-anthropic.hf.space
```
3. Add your Anthropic API key in the authorization field (as a Bearer token)
4. Save the configuration

The service will automatically fetch available models from:
```
https://cotcotquedec-openwebui-anthropic.hf.space/models
```

## πŸ”’ Security

- Your Anthropic API key is only used to authenticate requests to Anthropic's API
- The key is never stored or write anywhere
- All communication is encrypted via HTTPS

## 🌟 Features

- Compatible with OpenWebUI's interface
- Supports streaming responses
- Handles both chat completions and regular completions
- Automatic token management

## πŸ“ Usage Notes

- The service acts as a proxy between OpenWebUI and Anthropic's API
- Response formats are automatically converted to be compatible with OpenWebUI
- All Claude model features are supported (including system prompts)

## ⚠️ Limitations

- The service is designed specifically for OpenWebUI integration
- API calls require a valid Anthropic API key
- Usage is subject to Anthropic's rate limits and pricing

## πŸ”— Related Links

- [Anthropic API Documentation](https://docs.anthropic.com/claude/docs)
- [OpenWebUI Documentation](https://docs.openwebui.com/)
- [Hugging Face Spaces Documentation](https://huggingface.co./docs/hub/spaces)

## πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

## ✨ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---
For more information about space configuration, check out the [Hugging Face Spaces configuration reference](https://huggingface.co./docs/hub/spaces-config-reference).