Utility functions and constants for LLM model backend types and deployment status.
// Source: https://github.com/yunionio/cloudpods | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package llm
import (
"strings"
"yunion.io/x/pkg/util/sets"
"yunion.io/x/onecloud/pkg/apis"
computeapi "yunion.io/x/onecloud/pkg/apis/compute"
)
// Backend types for LLMModel
const (
LLM_MODEL_BACKEND_VLLM = "vllm"
LLM_MODEL_BACKEND_OLLAMA = "ollama"
LLM_MODEL_BACKEND_SGLANG = "sglang"
LLM_MODEL_BACKEND_CUSTOM = "custom"
)
var LLM_MODEL_BACKENDS = sets.NewString(
LLM_MODEL_BACKEND_VLLM,
LLM_MODEL_BACKEND_OLLAMA,
LLM_MODEL_BACKEND_SGLANG,
LLM_MODEL_BACKEND_CUSTOM,
)
func IsLLMModelBackend(t string) bool {
return LLM_MODEL_BACKENDS.Has(strings.ToLower(t))
}
// Placem
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key