Skip to content

Commit 8dd5684

Browse files
committed
Larger context windows
1 parent b1d1d54 commit 8dd5684

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+307
-103
lines changed

src/components/models/ModelBadges.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ const ModelBadges = ({ model }: { model: WorkersAIModelsSchema }) => {
3333
<ul className="m-0 flex list-none items-center gap-2 p-0 text-xs">
3434
{badges.map((badge) => (
3535
<li key={badge.text}>
36-
<span className="sl-badge gray">{badge.text}</span>
36+
<span className="sl-badge default">{badge.text}</span>
3737
</li>
3838
))}
3939
</ul>
4040
);
4141
};
4242

43-
export default ModelBadges;
43+
export default ModelBadges;
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import type { WorkersAIModelsSchema } from "~/schemas";
2+
3+
const ModelFeatures = ({ model }: { model: WorkersAIModelsSchema }) => {
4+
const nf = new Intl.NumberFormat("en-US");
5+
const properties: any = {};
6+
model.properties.forEach((property: any) => {
7+
properties[property.property_id] = property.value;
8+
});
9+
10+
return (
11+
<>
12+
{Object.keys(properties).length && (
13+
<>
14+
<table>
15+
<thead>
16+
<tr>
17+
<>
18+
<th>Features</th>
19+
<th />
20+
</>
21+
</tr>
22+
</thead>
23+
<tbody>
24+
{properties.planned_deprecation_date && (
25+
<tr>
26+
<td>
27+
{Date.now() >
28+
Math.floor(
29+
new Date(properties.planned_deprecation_date).getTime() /
30+
1000,
31+
)
32+
? "Deprecated"
33+
: "Planned Deprecation"}
34+
</td>
35+
<td>
36+
{new Date(
37+
properties.planned_deprecation_date,
38+
).toLocaleDateString("en-US")}
39+
</td>
40+
</tr>
41+
)}
42+
{properties.context_window && (
43+
<tr>
44+
<td>
45+
Context Window
46+
<a href="/workers-ai/glossary/">
47+
<span className="external-link"></span>
48+
</a>
49+
</td>
50+
<td>{nf.format(properties.context_window)} tokens</td>
51+
</tr>
52+
)}
53+
{properties.terms && (
54+
<tr>
55+
<td>Terms and License</td>
56+
<td>
57+
<a href={properties.terms} target="_blank">
58+
link<span className="external-link"></span>
59+
</a>
60+
</td>
61+
</tr>
62+
)}
63+
{properties.info && (
64+
<tr>
65+
<td>More information</td>
66+
<td>
67+
<a href={properties.info} target="_blank">
68+
link<span className="external-link"></span>
69+
</a>
70+
</td>
71+
</tr>
72+
)}
73+
{properties.max_input_tokens && (
74+
<tr>
75+
<td>Maximum Input Tokens</td>
76+
<td>{nf.format(properties.max_input_tokens)}</td>
77+
</tr>
78+
)}
79+
{properties.output_dimensions && (
80+
<tr>
81+
<td>Output Dimensions</td>
82+
<td>{nf.format(properties.output_dimensions)}</td>
83+
</tr>
84+
)}
85+
{properties.function_calling && (
86+
<tr>
87+
<td>
88+
Function calling{" "}
89+
<a href="/workers-ai/function-calling">
90+
<span className="external-link"></span>
91+
</a>
92+
</td>
93+
<td>Yes</td>
94+
</tr>
95+
)}
96+
{properties.lora && (
97+
<tr>
98+
<td>LoRA</td>
99+
<td>Yes</td>
100+
</tr>
101+
)}
102+
{properties.beta && (
103+
<tr>
104+
<td>Beta</td>
105+
<td>Yes</td>
106+
</tr>
107+
)}
108+
</tbody>
109+
</table>
110+
</>
111+
)}
112+
</>
113+
);
114+
};
115+
116+
export default ModelFeatures;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Workers AI larger context windows
3+
description: Updated Workers AI models with larger context windows
4+
date: 2025-02-24T11:00:00Z
5+
---
6+
7+
We've updated the Workers AI text generation models to include context windows and limits definitions and changed our APIs to estimate and validate the number of tokens in the input prompt, not the number of characters.
8+
9+
This update allows developers to use larger context windows when interacting with Workers AI models, which can lead to better and more accurate results.
10+
11+
Our [catalog page](/workers-ai/models/) provides more information about each model's supported context window.

src/content/glossary/workers-ai.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ entries:
44
- term: Workers AI
55
general_definition: |-
66
[Workers AI](/workers-ai/) is a Cloudflare service that enables running machine learning models on Cloudflare's global network, utilizing serverless GPUs. It allows developers to integrate AI capabilities into their applications using Workers, Pages, or via the REST API.
7+
- term: Context Window
8+
general_definition: In generative AI, the context window is the sum of the number of input, reasoning, and completion or response tokens a model supports. You can find the context window limit on each [model page](/workers-ai/models/).
9+
- term: Maximum Tokens
10+
general_definition: In generative AI, the user-defined property `max_tokens` defines the maximum number of tokens at which the model should stop responding. This limit cannot exceed the context window.
711
- term: Serverless GPUs
812
general_definition: |-
913
[Serverless GPUs](/workers-ai/) are graphics processing units provided by Cloudflare in a serverless environment, enabling scalable and efficient execution of machine learning models without the need for managing underlying hardware.
@@ -54,4 +58,4 @@ entries:
5458
[D1](/d1/) is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.
5559
- term: Inference
5660
general_definition: |-
57-
[Inference](/workers-ai/fine-tunes/public-loras/#running-inference-with-public-loras) refers to the process of using a trained machine learning model to make predictions or generate outputs based on new data.
61+
[Inference](/workers-ai/fine-tunes/public-loras/#running-inference-with-public-loras) refers to the process of using a trained machine learning model to make predictions or generate outputs based on new data.

src/content/workers-ai-models/deepseek-coder-6.7b-base-awq.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"property_id": "beta",
1515
"value": "true"
1616
},
17+
{
18+
"property_id": "context_window",
19+
"value": "4096"
20+
},
1721
{
1822
"property_id": "terms",
1923
"value": "https://huggingface.co/TheBloke/deepseek-coder-6.7B-base-AWQ"

src/content/workers-ai-models/deepseek-coder-6.7b-instruct-awq.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"property_id": "beta",
1515
"value": "true"
1616
},
17+
{
18+
"property_id": "context_window",
19+
"value": "4096"
20+
},
1721
{
1822
"property_id": "terms",
1923
"value": "https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-AWQ"

src/content/workers-ai-models/deepseek-math-7b-instruct.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"property_id": "beta",
1515
"value": "true"
1616
},
17+
{
18+
"property_id": "context_window",
19+
"value": "4096"
20+
},
1721
{
1822
"property_id": "info",
1923
"value": "https://huggingface.co/deepseek-ai/deepseek-math-7b-instruct"

src/content/workers-ai-models/deepseek-r1-distill-qwen-32b.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
},
1111
"tags": [],
1212
"properties": [
13+
{
14+
"property_id": "context_window",
15+
"value": "80000"
16+
},
1317
{
1418
"property_id": "terms",
1519
"value": "https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE"

src/content/workers-ai-models/discolm-german-7b-v1-awq.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"property_id": "beta",
1515
"value": "true"
1616
},
17+
{
18+
"property_id": "context_window",
19+
"value": "4096"
20+
},
1721
{
1822
"property_id": "info",
1923
"value": "https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-AWQ"

src/content/workers-ai-models/falcon-7b-instruct.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"property_id": "beta",
1515
"value": "true"
1616
},
17+
{
18+
"property_id": "context_window",
19+
"value": "4096"
20+
},
1721
{
1822
"property_id": "info",
1923
"value": "https://huggingface.co/tiiuae/falcon-7b-instruct"

0 commit comments

Comments
 (0)