Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions clarifai/cli/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
DEFAULT_LOCAL_RUNNER_NODEPOOL_CONFIG,
DEFAULT_LOCAL_RUNNER_NODEPOOL_ID,
DEFAULT_OLLAMA_MODEL_REPO_BRANCH,
DEFAULT_PYTHON_MODEL_REPO_BRANCH,
DEFAULT_TOOLKIT_MODEL_REPO,
DEFAULT_VLLM_MODEL_REPO_BRANCH,
)
Expand Down Expand Up @@ -74,9 +75,11 @@ def model():
)
@click.option(
'--toolkit',
type=click.Choice(['ollama', 'huggingface', 'lmstudio', 'vllm'], case_sensitive=False),
type=click.Choice(
['ollama', 'huggingface', 'lmstudio', 'vllm', 'python'], case_sensitive=False
),
required=False,
help='Toolkit to use for model initialization. Currently supports "ollama", "huggingface", "lmstudio" and "vllm".',
help='Toolkit to use for model initialization. Currently supports "ollama", "huggingface", "lmstudio", "vllm" and "python".',
)
@click.option(
'--model-name',
Expand Down Expand Up @@ -124,7 +127,7 @@ def init(
MODEL_TYPE_ID: Type of model to create. If not specified, defaults to "text-to-text" for text models.\n
GITHUB_PAT: GitHub Personal Access Token for authentication when cloning private repositories.\n
GITHUB_URL: GitHub repository URL or "repo" format to clone a repository from. If provided, the entire repository contents will be copied to the target directory instead of using default templates.\n
TOOLKIT: Toolkit to use for model initialization. Currently supports "ollama", "huggingface", "lmstudio" and "vllm".\n
TOOLKIT: Toolkit to use for model initialization. Currently supports "ollama", "huggingface", "lmstudio", "vllm" and "python".\n
MODEL_NAME: Model name to configure when using --toolkit. For ollama toolkit, this sets the Ollama model to use (e.g., "llama3.1", "mistral", etc.). For vllm & huggingface toolkit, this sets the Hugging Face model repo_id (e.g., "Qwen/Qwen3-4B-Instruct-2507"). For lmstudio toolkit, this sets the LM Studio model name (e.g., "qwen/qwen3-4b-thinking-2507").\n
PORT: Port to run the (Ollama/lmstudio) server on. Defaults to 23333.\n
CONTEXT_LENGTH: Context length for the (Ollama/lmstudio) model. Defaults to 8192.\n
Expand Down Expand Up @@ -176,6 +179,9 @@ def init(
elif toolkit == 'vllm':
github_url = DEFAULT_TOOLKIT_MODEL_REPO
branch = DEFAULT_VLLM_MODEL_REPO_BRANCH
elif toolkit == 'python':
github_url = DEFAULT_TOOLKIT_MODEL_REPO
branch = DEFAULT_PYTHON_MODEL_REPO_BRANCH

if github_url:
downloader = GitHubDownloader(
Expand Down
1 change: 1 addition & 0 deletions clarifai/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
DEFAULT_HF_MODEL_REPO_BRANCH = "huggingface"
DEFAULT_LMSTUDIO_MODEL_REPO_BRANCH = "lmstudio"
DEFAULT_VLLM_MODEL_REPO_BRANCH = "vllm"
DEFAULT_PYTHON_MODEL_REPO_BRANCH = "python"

STATUS_OK = "200 OK"
STATUS_MIXED = "207 MIXED"
Expand Down
Loading