This commit is contained in:
Saifeddine ALOUI 2024-02-04 19:04:01 +01:00
commit e3f5679672
1 changed files with 3 additions and 3 deletions

View File

@ -41,8 +41,8 @@ Replace `http://localhost:11434/` with the URL and port of the first server. The
### Authorized users (authorized_users.txt)
Create a file named `authorized_users.txt` in the same directory as your script, containing a list of user:key pairs, separated by commas and each on a new line:
```text
user1,key1
user2,key2
user1:key1
user2:key2
```
Replace `user1`, `key1`, `user2`, and `key2` with the desired username and API key for each user.
You can also use the `ollama_proxy_add_user` utility to add user and generate a key automatically:
@ -67,7 +67,7 @@ Replace `<METHOD>` with the HTTP method (GET or POST), `<USER_KEY>` with a valid
For example:
```bash
curl -X POST -H "Authorization: Bearer user1:key1" http://localhost:8080/api/generate --data '{"data": "Hello, World!"}'
curl -X POST -H "Authorization: Bearer user1:key1" http://localhost:8080/api/generate --data '{'model':'mixtral:latest,'prompt': "Once apon a time,","stream":false,"temperature": 0.3,"max_tokens": 1024}'
```
### Starting the server using the created Container-Image
To start the proxy in background with the above created image, you can use either