Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #77 from jina-ai/docs-pricing-refactor
Browse files Browse the repository at this point in the history
docs: refactor pricing
  • Loading branch information
deepankarm authored May 17, 2023
2 parents 1e5966f + cb2e0a0 commit f26bf76
Showing 1 changed file with 47 additions and 20 deletions.
67 changes: 47 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,8 @@ curl -sX POST 'https://langchain.wolf.jina.ai/api/run' \
| List all apps on Jina AI Cloud | `lc-serve list` |
| Remove app on Jina AI Cloud | `lc-serve remove <app-id>` |

## JCloud
### Configurations
# JCloud
## Configurations

For JCloud deployment, you can configure your application infrastructure by providing a YAML configuration file using the `--config` option. The supported configurations are:

Expand All @@ -680,38 +680,65 @@ If you don't provide a configuration file or a specific configuration isn't spec
instance: C3
autoscale_min: 1
```
### Pricing
For applications hosted on JCloud, our pricing is determined according to the instance type (as defined by [Jina AI Cloud](https://docs.jina.ai/concepts/jcloud/configuration/#cpu-tiers)) and the duration for which your application serves, and the cost associated with maintaining the minimum number of application replicas. To calculate the cost for the last hour, use the following formula:
```
Hourly Cost = (Hourly Credits for Selected Instance Type) * (Serving Duration in Last Hour)
+ (Hourly Credits for Selected Instance Type) * (Minimum Number of Autoscale Configuration Replicas)
```
And price per credit is €0.005 as per the [Jina AI Cloud Pricing](https://docs.jina.ai/concepts/jcloud/configuration/#cpu-tiers).
## Pricing

By default, if no explicit configuration is provided, the following settings will be applied:
Applications hosted on JCloud are priced in two categories:

```
instance: C3
autoscale_min: 1
```
**Base credits**

- Base credits are charged to ensure high availability for your application by maintaining at least one instance running continuously, ready to handle incoming requests.
- Actual credits charged for base credits are calculated based on the [instance type as defined by Jina AI Cloud](https://docs.jina.ai/concepts/jcloud/configuration/#cpu-tiers).
- By default, instance type `C3` is used with a minimum of 1 instance, which means that if your application is served on JCloud, you will be charged 10 credits per hour.
- You can change the instance type and the minimum number of instances by providing a YAML configuration file using the `--config` option. For example, if you want to use instance type `C4` with a minimum of 0 replicas, you can provide the following configuration file:
```yaml
instance: C4
autoscale_min: 0
```

**Serving credits**

- Serving credits are charged when your application is actively serving incoming requests.
- Actual credits charged for serving credits are calculated based on the credits for the instance type multiplied by the duration for which your application serves requests.
- You are charged for each second your application is serving requests.

Example 1:

Consider a HTTP application which, in the last hour, has served requests for `10` minutes (either sequentially or concurrently). The application configuration is as follows:
**Total credits charged = Base credits + Serving credits**

[Jina AI Cloud](https://cloud.jina.ai/pricing) defines each credit as €0.005.

### Examples

**Example 1:**

Consider an HTTP application that has served requests for `10` minutes in the last hour and uses a custom config:
```
instance: C4
autoscale_min: 0
```
In this case, the cost would be approximately `3.33` credits. The calculation is `20 * 10/60 + 20 * 0`, where `20` is the hourly credit rate for a `C4` instance.

Example 2:
Total credits per hour charged would be `3.33`. The calculation is as follows:
```
C4 instance has an hourly credit rate of 20.
Base credits = 0 (since `autoscale_min` is 0)
Serving credits = 20 * 10/60 = 3.33
Total credits per hour = 3.33
```

**Example 2:**

Now, consider a WebSocket application which, in the last hour, has actively served requests for 10 minutes, but was connected for 20 minutes. The application uses the default configuration:
Consider a WebSocket application that had active connections for 20 minutes in the last hour and uses the default configuration.
```
instance: C3
autoscale_min: 1
```
The cost here would be approximately `13.33` credits. The calculation is `10 * 20/60 + 10 * 1 = 3.33`, where `10` is the hourly credit rate for a `C3` instance. Note that we use `20` as the duration of serving, rather than `10`, as we measure the cost based on the duration the decorated function serves, not the duration during which it actively serves clients.

Total credits per hour charged would be `13.33`. The calculation is as follows:
```
C3 instance has an hourly credit rate of 10.
Base credits = 10 (since `autoscale_min` is 1)
Serving credits = 10 * 20/60 = 3.33
Total credits per hour = 10 + 3.33 = 13.33
```

# :grey_question: Frequently Asked Questions

Expand Down

0 comments on commit f26bf76

Please sign in to comment.