Elffuss BraidHub

kikocis/continue public

37eef76c38ed · 2.5 KiBRawPermalink
1---
2title: "Cloudflare"
3---
4
5Cloudflare Workers AI can be used for both chat and tab autocompletion in Continue. Here is an example of Cloudflare Workers AI configuration:
6
7<Tabs>
8 <Tab title="YAML">
9 ```yaml title="config.yaml"
10 models:
11 - name: Llama 3 8B
12 provider: cloudflare
13 apiKey: <YOUR_CLOUDFARE_API_KEY>
14 model: "@cf/meta/llama-3-8b-instruct"
15 contextLength: 2400
16 defaultCompletionOptions:
17 maxTokens: 500
18 roles:
19 - chat
20 env:
21 accountId: YOUR CLOUDFLARE ACCOUNT ID
22 - name: DeepSeek Coder 6.7b Instruct
23 provider: cloudflare
24 apiKey: <YOUR_CLOUDFARE_API_KEY>
25 model: "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
26 contextLength: 2400
27 defaultCompletionOptions:
28 maxTokens: 500
29 roles:
30 - chat
31 env:
32 accountId: YOUR CLOUDFLARE ACCOUNT ID
33 - name: DeepSeek 7b
34 provider: cloudflare
35 apiKey: <YOUR_CLOUDFARE_API_KEY>
36 model: "@hf/thebloke/deepseek-coder-6.7b-base-awq"
37 roles:
38 - autocomplete
39 env:
40 accountId: YOUR CLOUDFLARE ACCOUNT ID
41 ```
42 </Tab>
43 <Tab title="JSON">
44 ```json title="config.json"
45 {
46 "models": [
47 {
48 "title": "Llama 3 8B",
49 "provider": "cloudflare",
50 "accountId": "YOUR CLOUDFLARE ACCOUNT ID",
51 "apiKey": "YOUR CLOUDFLARE API KEY",
52 "contextLength": 2400,
53 "completionOptions": {
54 "maxTokens": 500
55 },
56 "model": "@cf/meta/llama-3-8b-instruct"
57 },
58 {
59 "title": "DeepSeek Coder 6.7b Instruct",
60 "provider": "cloudflare",
61 "accountId": "YOUR CLOUDFLARE ACCOUNT ID",
62 "apiKey": "YOUR CLOUDFLARE API KEY",
63 "contextLength": 2400,
64 "completionOptions": {
65 "maxTokens": 500
66 },
67 "model": "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
68 }
69 ],
70 "tabAutocompleteModel": {
71 "title": "DeepSeek 7b",
72 "provider": "cloudflare",
73 "accountId": "YOUR CLOUDFLARE ACCOUNT ID",
74 "apiKey": "YOUR CLOUDFLARE API KEY",
75 "model": "@hf/thebloke/deepseek-coder-6.7b-base-awq"
76 }
77 }
78 ```
79 </Tab>
80</Tabs>
81
82Visit the [Cloudflare dashboard](https://dash.cloudflare.com/) to [create an API key](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).
83
84Review [available models](https://developers.cloudflare.com/workers-ai/models/) on Workers AI
85
86[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Cloudflare.ts)