Files
ubicloud/routes/project/inference_playground.rb
Junhao Li 5cc0a71f31 Add UI for inference router models
Create model cards for the visible inference router models alongside
the inference endpoints.
2025-04-29 10:27:18 -04:00

17 lines
927 B
Ruby

# frozen_string_literal: true
class Clover
hash_branch(:project_prefix, "inference-playground") do |r|
r.get web? do
inference_endpoints = Serializers::InferenceEndpoint.serialize(inference_endpoint_ds.eager(:location).where(Sequel.pg_jsonb_op(:tags).get_text("capability") => "Text Generation"))
inference_router_models = Serializers::InferenceRouterModel.serialize(inference_router_model_ds.where(Sequel.pg_jsonb_op(:tags).get_text("capability") => "Text Generation").all)
@inference_models = inference_endpoints + inference_router_models
@inference_api_keys = Serializers::InferenceApiKey.serialize(inference_api_key_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/playground"
end
end
end