|
| 1 | +// Module included in the following assemblies: |
| 2 | +// * TBD |
| 3 | + |
| 4 | +:_mod-docs-content-type: PROCEDURE |
| 5 | +[id="ols-activating-token-quota-limits_{context}"] |
| 6 | += Activating token quota limits |
| 7 | + |
| 8 | +Modify the `OLSConfigMap` file to activate token quota limits for the {ols-long} Service. |
| 9 | + |
| 10 | +.Prerequisites |
| 11 | + |
| 12 | +* You have installed the the {ols-long} Operator. |
| 13 | +
|
| 14 | +* You have configured a large language model provider (LLM). |
| 15 | +
|
| 16 | +* A PostgresSQL database is configured and the {ols-long} Service can access the database. |
| 17 | +
|
| 18 | +.Procedure |
| 19 | + |
| 20 | +. Open the {ols-long} `ConfigMap` file by running the following command: |
| 21 | ++ |
| 22 | +[source,terminal] |
| 23 | +---- |
| 24 | +$ oc edit configmap <configmap_filename> |
| 25 | +---- |
| 26 | + |
| 27 | +. Modify the `data` property of the `ConfigMap` file to include token quota limit information. The following example defines the configuration in a file using key-value pairs. The {ols-long} pod mounts the `ConfigMap` resource as a volume, enabling access to the file stored within it. The `OLSConfig` Custom Resource (CR) references the `ConfigMap` resource to obtain the quota limit information. |
| 28 | ++ |
| 29 | +.Example {ols-long} `ConfigMap` file |
| 30 | +[source,yaml] |
| 31 | +---- |
| 32 | +apiVersion: v1 |
| 33 | +kind: ConfigMap |
| 34 | +metadata: |
| 35 | + name: quota-limit |
| 36 | + namespace: openshift-lightspeed |
| 37 | +data: |
| 38 | + quota_handlers.conf: |
| 39 | + storage: |
| 40 | + host: <IP_address> <1> |
| 41 | + port: "5432" |
| 42 | + dbname: <database_name> |
| 43 | + user: <user_name> |
| 44 | + password_path: <file_containing_database_password> |
| 45 | + ssl_mode: disable |
| 46 | + limiters: |
| 47 | + - name: user_monthly_limits |
| 48 | + type: user_limiter |
| 49 | + initial_quota: 100000 <2> |
| 50 | + quota_increase: 10 |
| 51 | + period: 30 days |
| 52 | + - name: cluster_monthly_limits |
| 53 | + type: cluster_limiter |
| 54 | + quota_increase: 1000000 <3> |
| 55 | + period: 30 days |
| 56 | + scheduler: |
| 57 | + period: 300 <4> |
| 58 | +---- |
| 59 | +<1> Specifies the IP address for the PostgresSQL database. The database must use port `5432`. |
| 60 | +<2> Specifies a token quota limit of 100,000 for each user over a period of 30 days. |
| 61 | +<3> Increases the token quota limit for the cluster by 100,000 over a period of 30 days. |
| 62 | +<4> Defines the number of seconds that the scheduler waits and then checks if the period interval is over. When the period interval is over, the scheduler stores the timestamp and resets or increases the quota limit. |
| 63 | + |
| 64 | +. Apply the `ConfigMap` file so that the token limit quota takes effect by running the following command: |
| 65 | ++ |
| 66 | +[source,terminal] |
| 67 | +---- |
| 68 | +$ oc apply -f <configmap_name> |
| 69 | +---- |
0 commit comments