Elffuss BraidHub

kikocis/continue public

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