Skip to content

Commit

Permalink
correct typos
Browse files Browse the repository at this point in the history
  • Loading branch information
sai80082 committed Aug 3, 2024
1 parent a26df92 commit b16f7a5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cloudflare Ai Proxy

I made this script mainly targeted for nextlcoud assistant because cloudflare provides Ai endpoints as openai API format for a good number of requests (almost for free) so why not use it instead of hosting our own instance of AI.
I made this script mainly targeted for nextcloud assistant because cloudflare provides Ai endpoints as openai API format for a good number of requests (almost for free) so why not use it instead of hosting our own instance of AI.



Expand All @@ -14,26 +14,26 @@ Response:
```json
{"result":null,"success":false,"errors":[{"code":7001,"message":"GET not supported for requested URI."}],"messages":[]}
```
This is because cloudflare dosen't provide `/v1/models` in their API to solve this i created this script which returns the list of models from the list specified in `main.py` and rest requests are directly passed to the cloudflare API.
This is because cloudflare doesn't provide `/v1/models` in their API to solve this i created this script which returns the list of models from the list specified in `main.py` and rest requests are directly passed to the cloudflare API.

## How to use

### 1. Make sure you installed Nexlcoud assistant and openai integration in your nextcloud instance
### 2. Get account id and api key from cloudflare [more info](https://developers.cloudflare.com/workers-ai/get-started/rest-api/#1-get-api-token-and-account-id)
### 1. Make sure you installed Nextcloud assistant and openai integration in your nextcloud instance
### 2. Get account id and API key from cloudflare [more info](https://developers.cloudflare.com/workers-ai/get-started/rest-api/#1-get-api-token-and-account-id)
### 3. Docker run

```
docker run -d -e ACCOUNTID=XXXXXXXXXXXX -p 5050:5050 ghcr.io/sai80082/cf-ai:main
```
replace the `XXXXXXXXXXXX` with the account id obtained from cloudflare
### 4. In nextlcoud
### 4. In nextcloud

- Go to administration settings -> Artificial intelligence
- Under OpenAI and LocalAI integration change

- service url: `http://\<machine-ip>:5050`

change machine-ip to your instace local ip address where this docker container is running.
change machine-ip to your instance local ip address where this docker container is running.
![Alt text](image.png)
- API key: paste the api key obtained from cloudflare.

Expand Down

0 comments on commit b16f7a5

Please sign in to comment.