Okay, let's break down Cloudflare's "neuron" pricing for Workers AI.
The key thing to understand is that "neurons" are an abstract unit of compute defined by Cloudflare, not a direct count of tokens or words. The number of neurons consumed depends heavily on the specific AI model you are using. Different models have different computational requirements.
Why No Fixed Conversion?
- Model Complexity: A large language model (like Llama 2 or Mistral) requires significantly more computation per token than a simpler model (like one for basic text classification or translation).
- Cloudflare's Abstraction: They use "neurons" to create a somewhat unified billing unit across various types of AI tasks and models running on their diverse hardware.
Estimates Based on Cloudflare's Examples (Important: Check current documentation for specifics):
Cloudflare often provides examples in their documentation or blog posts. While these can change, here are some rough estimates based on common models to give you an idea:
- Large Language Models (LLMs) like Llama-2-7b-chat-fp16 or Mistral-7B: These are computationally intensive. A very rough estimate might be in the range of 50 to 150 neurons per 1,000 tokens (input + output combined). Some specific fine-tuned or quantized versions might be lower.
- Simpler Models (e.g., some Translation, Text Classification, Embeddings): These might be significantly cheaper, potentially in the range of 5 to 50 neurons per 1,000 tokens or per request/task, depending on how they are measured.
Calculating for the Free Tier (10,000 Neurons/Day):
Let's use hypothetical examples:
-
Scenario 1: Using a heavier LLM (e.g., 100 neurons / 1k tokens):
- 10,000 neurons / (100 neurons / 1k tokens) = 100 units of 1k tokens
- Total tokens: 100 * 1,000 = 100,000 tokens per day
-
Scenario 2: Using a lighter model (e.g., 20 neurons / 1k tokens):
- 10,000 neurons / (20 neurons / 1k tokens) = 500 units of 1k tokens
- Total tokens: 500 * 1,000 = 500,000 tokens per day
Tokens to Words:
A common rule of thumb is that 1 token is roughly equivalent to 0.75 words in English.
- Scenario 1 (100k tokens) ≈ 75,000 words per day
- Scenario 2 (500k tokens) ≈ 375,000 words per day
Conclusion:
Your free 10,000 neurons per day could equate to anywhere from tens of thousands to several hundred thousand tokens (input + output combined) processed per day.
- It depends entirely on which model(s) you use. Running complex chat models will burn through your free neurons much faster than running simpler embedding or classification models.
- Check the Cloudflare Workers AI documentation: The most accurate information will be on their official site, often listing the neuron cost per model. Look for the specific models you plan to use to get a precise neuron cost per 1k tokens or per inference. This is the only way to know for sure.