mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 22:02:18 +08:00
Add some model methods that allow for duck-typing InferenceEndpoint and InferenceRouterModel instances. Move the million_token_price method to be a Clover helper method.
13 lines
486 B
Ruby
13 lines
486 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover
|
|
hash_branch(:project_prefix, "inference-endpoint") do |r|
|
|
r.get web? do
|
|
@inference_models = inference_endpoint_ds.eager(:location).all + inference_router_model_ds.all
|
|
@remaining_free_quota = FreeQuota.remaining_free_quota("inference-tokens", @project.id)
|
|
@free_quota_unit = "inference tokens"
|
|
@has_valid_payment_method = @project.has_valid_payment_method?
|
|
view "inference/endpoint/index"
|
|
end
|
|
end
|
|
end
|