Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/unslothai/unsloth
/ functions
Functions
18,583 in github.com/unslothai/unsloth
⨍
Functions
18,583
◇
Types & classes
1,838
↳
Endpoints
316
↓ 17 callers
Function
_classify
Mirror _check_token_patterns: first match in dict order wins.
studio/backend/tests/test_audio_token_detection.py:12
↓ 17 callers
Method
_classify_gpu_offload
True if the model landed on a GPU, False if only CPU buffers landed despite GPU intent, None when there's no signal. Delegates to the shared
studio/backend/core/inference/llama_cpp.py:6798
↓ 17 callers
Function
_disable
(monkeypatch)
studio/backend/tests/test_mcp_stdio_pr5863.py:34
↓ 17 callers
Function
_fake_binary
Stub llama-server under a supported install layout.
studio/backend/tests/test_llama_cpp_freshness.py:77
↓ 17 callers
Function
_marker
(source_id: str, locator: str | None = None)
studio/backend/tests/test_openai_citation_markers.py:28
↓ 17 callers
Function
_require_rag
()
studio/backend/routes/rag.py:36
↓ 17 callers
Function
_resolve_base_model
If *model_name* points to a LoRA adapter, return its base model. Checks ``adapter_config.json`` locally first. Only calls the heavier ``get_b
studio/backend/utils/transformers_version.py:345
↓ 17 callers
Function
_responses_stream
Handle a streaming Responses API call, emitting named SSE events. For GGUF models the request goes directly to llama-server's ``/v1/chat/comp
studio/backend/routes/inference.py:8200
↓ 17 callers
Function
_run_in_sandbox
Run Python code in a sandboxed interpreter.
tests/python/test_e2e_no_torch_sandbox.py:67
↓ 17 callers
Function
_send_response
Send a response to the parent process.
studio/backend/core/export/worker.py:226
↓ 17 callers
Function
_sig
Valid capability token for ``ref`` under the patched test secret.
studio/backend/tests/test_preview_routes.py:51
↓ 17 callers
Function
_url
(path: str)
studio/backend/tests/test_providers_api.py:70
↓ 17 callers
Function
anthropic_messages_to_openai
Convert Anthropic messages + system to OpenAI-format message dicts. User messages with ``image`` blocks are emitted as OpenAI multimodal cont
studio/backend/core/inference/anthropic_compat.py:72
↓ 17 callers
Function
detect_mmproj_file
Find the mmproj GGUF for a model. ``path``: directory or a .gguf file. ``search_root``: optional ancestor to also walk (snapshot layouts wher
studio/backend/utils/models/model_config.py:1212
↓ 17 callers
Function
estimate_required_model_memory_gb
( model_name: str, *, hf_token: Optional[str] = None, training_type: Optional[str] = None,
studio/backend/utils/hardware/hardware.py:1480
↓ 17 callers
Function
existing_install_matches_plan
( install_dir: Path, host: HostInfo, plan: InstallReleasePlan )
studio/install_llama_prebuilt.py:6479
↓ 17 callers
Method
remove
()
studio/frontend/src/features/chat/runtime-provider.tsx:155
↓ 17 callers
Method
reset_generation_state
Reset any cached generation state to prevent hanging after errors
studio/backend/core/inference/inference.py:1918
↓ 17 callers
Function
run_bash
Run a bash fragment. 60s default tolerates slow CI shell startup.
tests/studio/install/test_llama_pr_force_and_source.py:21
↓ 17 callers
Function
setBackendError
( nextError: string, nextStatus: BackendStatus = "error", )
studio/frontend/src/hooks/use-tauri-backend.ts:127
↓ 17 callers
Method
terminate
(self)
studio/backend/tests/test_tensor_parallel.py:130
↓ 17 callers
Method
unload_model
Terminate the subprocess and cancel any in-flight download.
studio/backend/core/inference/llama_cpp.py:6815
↓ 16 callers
Function
_assert_env_set
(output: str, name: str, value: str)
unsloth_cli/tests/test_connect.py:31
↓ 16 callers
Method
_backend
(self, stdout_lines)
studio/backend/tests/test_llama_cpp_context_fit.py:524
↓ 16 callers
Method
_can_estimate_kv
True if we have enough GGUF metadata to estimate KV cache size.
studio/backend/core/inference/llama_cpp.py:2705
↓ 16 callers
Function
_capture
Drive ``stream_chat_completion`` against a mocked Anthropic response and return the SSE lines. Pass ``captured_body`` to also capture the outg
studio/backend/tests/test_anthropic_citations_edge.py:46
↓ 16 callers
Function
_content_block_stop
(index: int = 0)
studio/backend/tests/test_anthropic_citations_edge.py:132
↓ 16 callers
Function
_convo
(text = "summarize the whole document")
studio/backend/tests/test_rag_whole_document.py:207
↓ 16 callers
Function
_detect_safetensors_features
Classify reasoning/tool capabilities via the GGUF classifier so flags match across backends. gpt-oss is overridden: Harmony routes reasoning and
studio/backend/routes/inference.py:1266
↓ 16 callers
Function
_drive
(coro)
studio/backend/tests/test_anthropic_messages.py:1446
↓ 16 callers
Function
_load_run_command
Import `studio` without triggering server start; backend imports are lazy inside run().
unsloth_cli/tests/test_studio_run_parallel_flag.py:28
↓ 16 callers
Function
_log
(msg: str)
tests/studio/install/smoke_test_parallel_studio_home.py:41
↓ 16 callers
Function
_mk_dir
(parent: Path, name: str)
studio/backend/tests/test_cleanup_cancelled_checkpoints.py:30
↓ 16 callers
Function
_rocm_classify_unified_memory
Classify a ROCm device as unified-memory (APU) or discrete. Returns ``(gcn_arch, is_unified)``: - ``gcn_arch``: canonical arch string (e.g. `
studio/backend/core/training/worker.py:687
↓ 16 callers
Function
_step
Print a single step line in the column format.
studio/install_python_stack.py:1602
↓ 16 callers
Method
_upstream
( self, *runtime_versions, current_names: bool = False, )
tests/studio/install/test_selection_logic.py:2089
↓ 16 callers
Method
_visit_expr
(self, node: ast.AST, scope: Scope)
scripts/verify_import_hoist.py:339
↓ 16 callers
Function
apiUrl
(path: string)
studio/frontend/src/lib/api-base.ts:35
↓ 16 callers
Function
extract_quant_label
(filename: str)
studio/backend/hub/utils/gguf.py:233
↓ 16 callers
Function
first_match
Return (path, src) for the first existing candidate path, else None.
tests/version_compat/_fetch.py:52
↓ 16 callers
Method
flush
(self)
studio/backend/run.py:905
↓ 16 callers
Function
get_chat_template
( tokenizer, chat_template = "chatml", mapping = {"role" : "role", "content" : "content", "user" :
unsloth/chat_templates.py:1841
↓ 16 callers
Function
loadBool
(key: string, fallback: boolean)
studio/frontend/src/features/chat/stores/chat-runtime-store.ts:303
↓ 16 callers
Function
notifyChatHistoryUpdated
()
studio/frontend/src/features/chat/api/chat-api.ts:32
↓ 16 callers
Function
now
()
studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx:64
↓ 16 callers
Function
patch_saving_functions
(model, vision = False)
unsloth/save.py:4455
↓ 16 callers
Function
readNumberString
(value: unknown)
studio/frontend/src/features/recipe-studio/utils/import/helpers.ts:14
↓ 16 callers
Function
run_bash
Run a bash fragment, return stdout.
tests/studio/install/test_pr4562_bugfixes.py:56
↓ 16 callers
Function
run_test
(fn, *a, **kw)
studio/backend/tests/test_studio_api.py:856
↓ 16 callers
Function
safe_error_detail
Map an exception to a generic, client-safe message (never raw ``str(error)``, which can leak paths). Log the real exception server-side.
studio/backend/utils/utils.py:22
↓ 16 callers
Function
saveBool
(key: string, value: boolean)
studio/frontend/src/features/chat/stores/chat-runtime-store.ts:336
↓ 16 callers
Function
soft_fail
Hard fail in STRICT mode, info-warn otherwise.
tests/studio/playwright_chat_ui.py:112
↓ 16 callers
Function
toNumber
(value: unknown)
studio/frontend/src/features/training/lib/model-defaults.ts:46
↓ 16 callers
Function
useDebouncedValue
(value: T, delayMs = 300)
studio/frontend/src/hooks/use-debounced-value.ts:6
↓ 16 callers
Method
write
Return True if newly written, False if already present.
studio/backend/plugins/data-designer-github-repo-seed/src/data_designer_github_repo_seed/scraper_impl/state_store.py:92
↓ 15 callers
Function
_basic_payload
(**fields)
studio/backend/tests/test_anthropic_messages.py:1450
↓ 15 callers
Function
_content_block_start_text
()
studio/backend/tests/test_anthropic_citations_edge.py:108
↓ 15 callers
Function
_extra_args_requests_mtp
True if the effective --spec-type selects MTP (mtp/draft-mtp), so the budget must reserve for it.
studio/backend/core/inference/llama_cpp.py:947
↓ 15 callers
Function
_fake_llama_backend
( *, active = False, identifier = "model.gguf", gpu_offload = None, loaded = None, )
studio/backend/tests/test_training_vram_coexistence.py:56
↓ 15 callers
Method
_install_stream_mock
( monkeypatch, chunks, *, supports_reasoning = True, reasoning_always_
studio/backend/tests/test_responses_tool_passthrough.py:1034
↓ 15 callers
Function
_message_delta_end
()
studio/backend/tests/test_anthropic_citations_edge.py:136
↓ 15 callers
Function
_message_start
()
studio/backend/tests/test_anthropic_citations_edge.py:94
↓ 15 callers
Function
_message_stop
()
studio/backend/tests/test_anthropic_citations_edge.py:140
↓ 15 callers
Function
_meta
( files: list[dict], requires = None, version: str = "1.0.0", )
tests/security/test_scan_packages.py:1339
↓ 15 callers
Function
_mock_backend
Install a minimal stub backend on routes.inference. Generation methods record which path the route entered, then yield one content event so t
studio/backend/tests/test_anthropic_messages.py:1412
↓ 15 callers
Function
_no_private_use
(text: str)
studio/backend/tests/test_openai_citation_markers_edge.py:37
↓ 15 callers
Function
_patch_backends
Stub core.inference + routes.inference modules so the lazy imports inside training_vram resolve to fakes (avoids importing torch-heavy backends).
studio/backend/tests/test_training_vram_coexistence.py:75
↓ 15 callers
Function
_props
Build a fake device-properties object with the given attributes.
studio/backend/tests/test_rocm_oom_guard.py:27
↓ 15 callers
Function
_render
(template_name, messages, **kwargs)
tests/test_gemma4_chat_template.py:30
↓ 15 callers
Function
_unsloth_install_pretrain_detector
Attach a one-shot forward pre-hook recording whether a forward ran before trainer.train(), so prepare_for_training_mode can drop a torch.compile g
unsloth/models/_utils.py:280
↓ 15 callers
Method
_visit_body
(self, stmts, scope: Scope)
scripts/verify_import_hoist.py:158
↓ 15 callers
Function
anthropic_messages
Anthropic-compatible Messages API endpoint. Translates Anthropic message format to internal OpenAI format, runs through the existing age
studio/backend/routes/inference.py:9202
↓ 15 callers
Function
apply_approved_hashes
( attempts: Iterable[AssetChoice], checksums: ApprovedReleaseChecksums )
studio/install_llama_prebuilt.py:5945
↓ 15 callers
Method
clean_text
Remove unwanted characters, normalize whitespace
unsloth/dataprep/raw_text.py:257
↓ 15 callers
Function
compute_total_params
(arch: ModelArchConfig)
studio/backend/utils/hardware/vram_estimation.py:860
↓ 15 callers
Method
convert
(self, *args, **kwargs)
unsloth/import_fixes.py:1703
↓ 15 callers
Function
detect_gguf_model
Check if a local path is or contains a GGUF model file. Handles a direct .gguf path or a directory of .gguf files. Skips mmproj files (pass t
studio/backend/utils/models/model_config.py:1370
↓ 15 callers
Function
fail
(m)
tests/studio/playwright_chat_ime_i18n.py:88
↓ 15 callers
Method
fail
(self)
studio/backend/tests/test_offline_gguf_cache_fallback.py:506
↓ 15 callers
Function
formatGb
(value: number | null | undefined)
studio/frontend/src/features/settings/tabs/resources-tab.tsx:44
↓ 15 callers
Function
getDefaultDataSourceHandle
(direction: LayoutDirection)
studio/frontend/src/features/recipe-studio/utils/handles.ts:194
↓ 15 callers
Function
getDefaultDataTargetHandle
(direction: LayoutDirection)
studio/frontend/src/features/recipe-studio/utils/handles.ts:190
↓ 15 callers
Function
getOpenDocumentAttribute
( element: Element, namespaceUri: string, name: string, )
studio/frontend/src/features/chat/open-document.ts:713
↓ 15 callers
Function
get_base_model_from_lora_identifier
Resolve a LoRA adapter's base model for a LOCAL dir OR a REMOTE HF repo. ``get_base_model_from_lora`` only reads a local adapter directory (it re
studio/backend/utils/models/model_config.py:2319
↓ 15 callers
Method
graphql
( self, query: str, variables: Optional[Dict[str, Any]] = None, max_retries: i
studio/backend/plugins/data-designer-github-repo-seed/src/data_designer_github_repo_seed/scraper_impl/gh_client.py:153
↓ 15 callers
Function
grouped_gemm
Grouped GEMM for MoE MLPs. The implementation offers a number of fusions specific to MoE: - `permute_x`: fuse the permutation of hidden
unsloth/kernels/moe/grouped_gemm/interface.py:878
↓ 15 callers
Method
is_disconnected
(self)
studio/backend/tests/test_llama_route_timeouts.py:110
↓ 15 callers
Function
jobKeyOf
( kind: DownloadKind, repoId: string, variant: string | null, )
studio/frontend/src/features/hub/download-manager/download-manager-state.ts:130
↓ 15 callers
Function
parseNumber
(value?: string)
studio/frontend/src/features/recipe-studio/utils/parse.ts:4
↓ 15 callers
Method
post
(self, *args, **kwargs)
studio/backend/hub/tests/conftest.py:56
↓ 15 callers
Method
remove
(self)
unsloth/models/_utils.py:1257
↓ 15 callers
Function
resolve_model_class
(auto_model, config)
unsloth/models/_utils.py:658
↓ 15 callers
Method
response_payload
Machine-readable detail for the frontend. ``error_kind`` splits a user-approvable prompt (``remote_code_consent_required``) from a CRITICAL ha
studio/backend/utils/security/consent.py:57
↓ 15 callers
Function
seed_user
()
studio/backend/tests/test_api_key_expiry.py:32
↓ 15 callers
Method
start
Emit message_start and open the first text content block.
studio/backend/core/inference/anthropic_compat.py:263
↓ 15 callers
Method
start
( self, message_id: str, model: str, input_tokens: int = 0, )
studio/backend/core/inference/anthropic_compat.py:498
↓ 15 callers
Function
tokenizer
(loaded_model_tokenizer)
tests/saving/test_unsloth_save.py:98
↓ 14 callers
Function
_add
(p: Optional[Path])
studio/backend/routes/models.py:1050
↓ 14 callers
Method
_auth_headers
Build authentication headers using the provider's registry config.
studio/backend/core/inference/external_provider.py:778
↓ 14 callers
Function
_backend
Backend with just the dims the compute-buffer estimate reads.
studio/backend/tests/test_compute_buffer.py:64
← previous
next →
301–400 of 18,583, ranked by callers