Skip to content

Commit

Permalink
[Workers AI] Add pricing and model maturity (#13226)
Browse files Browse the repository at this point in the history
* first draft

* added pricing calculator image

* added pricing tables

* few copy tweaks

* Update models

* Add conditional beta pill to model page title

* Make non-beta models float to top of model index

* Add weight to sort models

* Add redirects

* Changes from PR review

* Replace pricing calc image

* Apply suggestions from code review

* Apply suggestions from code review

K -> ,000

* Fix wrangler hyperdrive binding key (#13190)

* [R2] runtime API: TypeScript formatting audit (#13200)

* [R2] runtime API: TypeScript formatting audit

* more edits

* [SSL] Fix mTLS for Workers redirect after bindings reorg (#13211)

* Fix mtls for workers redirect after bidings reorg

* Remove 301 to add again

* Re-add 301 to push and retrigger build

* connect your domain (#12701)

* first draft

* updating quotes

* additional updates

* Apply suggestions from code review

Co-authored-by: abstergail <[email protected]>

* updates with some feedback

* updates

* removing product filter, so fundamentals glossary is for all terms

* updating index pages for better mobile experience

* updates

* updating redirects

* fixing link

* updating dns limitations on the proxy status page. updating how cloudflare works feedback

* moving what is cloudflare changes to another branch

* restoring original file

* merging an older commit in

* updates

* updating weights and links

* revisions

* Apply suggestions from code review

Co-authored-by: abstergail <[email protected]>

* couple more updates

* final edits

* Apply suggestions from code review

Co-authored-by: marciocloudflare <[email protected]>

* fixing meta titles

---------

Co-authored-by: abstergail <[email protected]>
Co-authored-by: marciocloudflare <[email protected]>

* Revert Workers external_link pages as redirect targets (#13214)

* [WAI] codeowner update (#13216)

* [WAI] codeowner update

* npm run build

---------

Co-authored-by: Kody Jackson <[email protected]>

* Update smart-placement.md (#12455)

* Minor corrections (#12995)

"Developer" -> "Develop"
"Workers" -> "Worker's"

* [D1] Update Wrangler commands (#12336)

* [D1] Update Wrangler commands

* Apply suggestions from code review

Co-authored-by: Kate Tungusova <[email protected]>

* Remove npx from d1 commands

* Apply suggestions from code review

---------

Co-authored-by: Kate Tungusova <[email protected]>

* Document the workers no-importscripts compat flag (#12618)

* Document the workers no-importscripts compat flag

Refs: cloudflare/workerd#1556

* Update content/workers/_partials/_platform-compatibility-dates/no-importscripts.md

Co-authored-by: Kate Tungusova <[email protected]>

---------

Co-authored-by: Kate Tungusova <[email protected]>

* Clarify subrequest billing (#12873)

We don't bill for subrequests, but old language left it a bit ambiguous. This simplifies.

* [Gateway] Update app types (#12948)

Co-authored-by: Kate Tungusova <[email protected]>

* Clarify pricing <> Service Bindings (#11669)

* Link to Workers Trace Events documentation from Trace Events Logpush (#12307)

Currently this page doesn't actually explain what fields are available in logs, if you use Workers Trace Events Logpush. This fixes by adding a link to this page.

* resolving comments

---------

Co-authored-by: Michelle Chen <[email protected]>
Co-authored-by: Kate Tungusova <[email protected]>
Co-authored-by: Kane Wang <[email protected]>
Co-authored-by: Rebecca Tamachiro <[email protected]>
Co-authored-by: jason-cf <[email protected]>
Co-authored-by: abstergail <[email protected]>
Co-authored-by: marciocloudflare <[email protected]>
Co-authored-by: Kody Jackson <[email protected]>
Co-authored-by: Matt Silverlock <[email protected]>
Co-authored-by: Jürg Gutknecht <[email protected]>
Co-authored-by: Kian <[email protected]>
Co-authored-by: James M Snell <[email protected]>
Co-authored-by: Brendan Irvine-Broque <[email protected]>
Co-authored-by: Max Phillips <[email protected]>
Co-authored-by: MC <[email protected]>
  • Loading branch information
16 people authored Mar 1, 2024
1 parent 1ddf81c commit 3a01a53
Show file tree
Hide file tree
Showing 49 changed files with 421 additions and 2,870 deletions.
Binary file added assets/images/workers-ai/pricing-calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions content/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,9 @@
/workers-ai/models/translation/ /workers-ai/models/#translation 301
/workers-ai/models/text-classification/ /workers-ai/models/#text-classification 301
/workers-ai/models/image-classification/ /workers-ai/models/#image-classification 301
/workers-ai/models/codellama-7b-instruct-awq/ /workers-ai/models/ 301
/workers-ai/models/openchat_3.5-awq/ /workers-ai/models/ 301


# workers KV
/kv/platform/environments/ /kv/reference/environments/ 301
Expand Down
22 changes: 12 additions & 10 deletions content/workers-ai/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,34 @@ meta:
Run machine learning models, powered by serverless GPUs, on Cloudflare's global network.
{{</description>}}

{{<render file="_billing-announcement.md">}}

Workers AI allows you to run machine learning models, on the Cloudflare network, from your own code -- whether that be from Workers, Pages, or anywhere via REST API.

### Designed for developers

You shouldn't have to understand the ins and outs of machine learning to leverage the power of it. With a focus on developer experience, it's powerful, yet simple, and only a few lines of code to get started:

```js
import { Ai } from '@cloudflare/ai';
import { Ai } from "@cloudflare/ai";

const ai = new Ai(env.AI)
const ai = new Ai(env.AI);

const output = await ai.run('@cf/meta/llama-2-7b-chat-int8', {
prompt: 'Tell me about Workers AI'
})
const output = await ai.run("@cf/meta/llama-2-7b-chat-int8", {
prompt: "Tell me about Workers AI",
});
```

### Models you know and love

Workers AI comes with a curated set of popular open-source models that *just work*.
Workers AI comes with a curated set of popular open-source models that _just work_.

Supporting multiple classes of models, here are some AI tasks you can unlock with Workers AI:

* **Natural language processing** - text generation + summarization + classification + translation, similarity analysis, question answering
* **Image generation** - text to image generation tasks
* **Computer Vision** - image classification, object detection
* **Audio** - Automatic speech recognition (ASR)
- **Natural language processing** - text generation + summarization + classification + translation, similarity analysis, question answering
- **Image generation** - text to image generation tasks
- **Computer Vision** - image classification, object detection
- **Audio** - Automatic speech recognition (ASR)

### Runs on a global network of GPUs

Expand Down
12 changes: 12 additions & 0 deletions content/workers-ai/_partials/_billing-announcement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
_build:
publishResources: false
render: never
list: never
---

{{<Aside type="note">}}

Workers AI will begin billing for usage on non-beta models after April 1, 2024. Refer to [Pricing](/workers-ai/platform/pricing) for more details.

{{</Aside>}}
4 changes: 3 additions & 1 deletion content/workers-ai/models/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ hideChildren: true

Browse our entire catalog of models.

{{% models-grouped-by-task %}}
{{<render file="_billing-announcement.md">}}

{{% models-grouped-by-task %}}
5 changes: 4 additions & 1 deletion content/workers-ai/models/bart-large-cnn.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ model:
description: "Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text."
tags:
- "summarization"
properties: []
properties:
- property_id: "beta"
value: "true"
task_type: "summarization"
model_display_name: "bart-large-cnn"
layout: "model"
weight: 0
title: "bart-large-cnn"
json_schema:
input: "{\n \"type\": \"object\",\n \"properties\": {\n \"input_text\": {\n \"type\": \"string\"\n },\n \"max_length\": {\n \"type\": \"integer\",\n \"default\": 1024\n }\n },\n \"required\": [\n \"input_text\"\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/bge-base-en-v1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ model:
value: "768"
- property_id: "constellation_config"
value: "infer_response_cache: in_memory\n\nmax_requests_per_min:\n default: 180\n accounts:\n 32118455: 2160 # ai.cloudflare.com staging\n 50147400: 2160 # ai.cloudflare.com\n\nneurons:\n metrics:\n - name: input_tokens\n neuron_cost: 0.0060575\nmax_concurrent_requests: 100"
- property_id: "beta"
value: "false"
task_type: "text-embeddings"
model_display_name: "bge-base-en-v1.5"
layout: "model"
weight: 100
title: "bge-base-en-v1.5"
json_schema:
input: "{\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 100\n }\n ]\n }\n },\n \"required\": [\n \"text\"\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/bge-large-en-v1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ model:
value: "1024"
- property_id: "constellation_config"
value: "infer_response_cache: in_memory\n\nmax_requests_per_min:\n default: 120\n\nneurons:\n metrics:\n - name: input_tokens\n neuron_cost: 0.01858166667\nmax_concurrent_requests: 100"
- property_id: "beta"
value: "false"
task_type: "text-embeddings"
model_display_name: "bge-large-en-v1.5"
layout: "model"
weight: 100
title: "bge-large-en-v1.5"
json_schema:
input: "{\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 100\n }\n ]\n }\n },\n \"required\": [\n \"text\"\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/bge-small-en-v1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ model:
value: "384"
- property_id: "constellation_config"
value: "infer_response_cache: in_memory\n\nmax_requests_per_min:\n default: 180\n\nneurons:\n metrics:\n - name: input_tokens\n neuron_cost: 0.001840833333\nmax_concurrent_requests: 100"
- property_id: "beta"
value: "false"
task_type: "text-embeddings"
model_display_name: "bge-small-en-v1.5"
layout: "model"
weight: 100
title: "bge-small-en-v1.5"
json_schema:
input: "{\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 100\n }\n ]\n }\n },\n \"required\": [\n \"text\"\n ]\n}"
Expand Down
26 changes: 0 additions & 26 deletions content/workers-ai/models/codellama-7b-instruct-awq.md

This file was deleted.

3 changes: 3 additions & 0 deletions content/workers-ai/models/deepseek-coder-6.7b-base-awq.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ model:
properties:
- property_id: "terms"
value: "https://huggingface.co/TheBloke/deepseek-coder-6.7B-base-AWQ"
- property_id: "beta"
value: "true"
task_type: "text-generation"
model_display_name: "deepseek-coder-6.7b-base-awq"
layout: "model"
weight: 0
title: "deepseek-coder-6.7b-base-awq"
json_schema:
input: "{\n \"type\": \"object\",\n \"oneOf\": [\n {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"raw\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n {\n \"properties\": {\n \"messages\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"role\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n },\n \"required\": [\n \"role\",\n \"content\"\n ]\n }\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"messages\"\n ]\n }\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/deepseek-coder-6.7b-instruct-awq.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ model:
properties:
- property_id: "terms"
value: "https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-AWQ"
- property_id: "beta"
value: "true"
task_type: "text-generation"
model_display_name: "deepseek-coder-6.7b-instruct-awq"
layout: "model"
weight: 0
title: "deepseek-coder-6.7b-instruct-awq"
json_schema:
input: "{\n \"type\": \"object\",\n \"oneOf\": [\n {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"raw\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n {\n \"properties\": {\n \"messages\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"role\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n },\n \"required\": [\n \"role\",\n \"content\"\n ]\n }\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"messages\"\n ]\n }\n ]\n}"
Expand Down
5 changes: 4 additions & 1 deletion content/workers-ai/models/deepseek-math-7b-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ model:
description: "Family of generative text models, such as large language models (LLM), that can be adapted for a variety of natural language tasks."
tags:
- "text-generation"
properties: []
properties:
- property_id: "beta"
value: "true"
task_type: "text-generation"
model_display_name: "deepseek-math-7b-base"
layout: "model"
weight: 0
title: "deepseek-math-7b-base"
json_schema:
input: "{\n \"type\": \"object\",\n \"oneOf\": [\n {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"raw\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n {\n \"properties\": {\n \"messages\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"role\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n },\n \"required\": [\n \"role\",\n \"content\"\n ]\n }\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"messages\"\n ]\n }\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/deepseek-math-7b-instruct.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ model:
value: "https://huggingface.co/deepseek-ai/deepseek-math-7b-instruct"
- property_id: "terms"
value: "https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL"
- property_id: "beta"
value: "true"
task_type: "text-generation"
model_display_name: "deepseek-math-7b-instruct"
layout: "model"
weight: 0
title: "deepseek-math-7b-instruct"
json_schema:
input: "{\n \"type\": \"object\",\n \"oneOf\": [\n {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"raw\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n {\n \"properties\": {\n \"messages\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"role\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n },\n \"required\": [\n \"role\",\n \"content\"\n ]\n }\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"messages\"\n ]\n }\n ]\n}"
Expand Down
17 changes: 7 additions & 10 deletions content/workers-ai/models/detr-resnet-50.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
---
model:
id: "6ade40e1-1646-4013-8da0-95abb3360e33"
id: "cc34ce52-3059-415f-9a48-12aa919d37ee"
source: 1
name: "@cf/meta/detr-resnet-50"
description: "DEtection TRansformer (DETR) model with ResNet-50 backbone for image object detection."
name: "@cf/facebook/detr-resnet-50"
description: "DEtection TRansformer (DETR) model trained end-to-end on COCO 2017 object detection (118k annotated images)."
task:
id: "9c178979-90d9-49d8-9e2c-0f1cf01815d4"
name: "Object Detection"
description: "Object detection models can detect instances of objects like persons, faces, license plates, or others in an image. This task takes an image as input and returns a list of detected objects, each one containing a label, a probability score, and its surrounding box coordinates."
tags:
- "experimental"
- "meta"
- "text-generation"
- "object-detection"
properties:
- property_id: "info"
value: "https://huggingface.co/facebook/detr-resnet-50"
- property_id: "constellation_config"
value: "max_requests_per_min:\n default: 180\n\nneurons:\n cost_per_infer: 0.6841666668 # ...3x that of resnet-50 (:shrug:).\nmax_concurrent_requests: 100"
- property_id: "beta"
value: "true"
task_type: "object-detection"
model_display_name: "detr-resnet-50"
layout: "model"
weight: 0
title: "detr-resnet-50"
json_schema:
input: "{\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"format\": \"binary\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"image\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n }\n }\n }\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/discolm-german-7b-v1-awq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ model:
properties:
- property_id: "info"
value: "https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-AWQ"
- property_id: "beta"
value: "true"
task_type: "text-generation"
model_display_name: "discolm-german-7b-v1-awq"
layout: "model"
weight: 0
title: "discolm-german-7b-v1-awq"
json_schema:
input: "{\n \"type\": \"object\",\n \"oneOf\": [\n {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n },\n \"raw\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n {\n \"properties\": {\n \"messages\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"role\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\",\n \"maxLength\": 4096\n }\n },\n \"required\": [\n \"role\",\n \"content\"\n ]\n }\n },\n \"stream\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"max_tokens\": {\n \"type\": \"integer\",\n \"default\": 256\n }\n },\n \"required\": [\n \"messages\"\n ]\n }\n ]\n}"
Expand Down
3 changes: 3 additions & 0 deletions content/workers-ai/models/distilbert-sst-2-int8.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ model:
properties:
- property_id: "info"
value: "https://huggingface.co/Intel/distilbert-base-uncased-finetuned-sst-2-english-int8-static"
- property_id: "beta"
value: "false"
task_type: "text-classification"
model_display_name: "distilbert-sst-2-int8"
layout: "model"
weight: 100
title: "distilbert-sst-2-int8"
json_schema:
input: "{\n \"type\": \"object\",\n \"properties\": {\n \"text\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"text\"\n ]\n}"
Expand Down
Loading

0 comments on commit 3a01a53

Please sign in to comment.