Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NVIDIA-NeMo/Switchyard
/ functions
Functions
4,886 in github.com/NVIDIA-NeMo/Switchyard
⨍
Functions
4,886
◇
Types & classes
851
↳
Endpoints
27
↓ 3 callers
Function
_assistant_text
(response: ChatResponse)
tests/e2e/test_llm_classifier_e2e.py:193
↓ 3 callers
Function
_body
(exc_message: str, inbound: str)
tests/test_context_error_translation.py:13
↓ 3 callers
Function
_build_affinity_l2
Build the optional shared L2 latch store (``None`` = L1-only). Uses the shared ``affinity_store`` semantics; ``"redis"`` imports :class:`Redi
switchyard/lib/profiles/escalation_router_profile_config.py:138
↓ 3 callers
Function
_build_chain
Build (processors, backend) for the classifier routing chain.
tests/e2e/test_llm_classifier_e2e.py:105
↓ 3 callers
Function
_bundle
(route: dict[str, Any])
tests/test_subagent_routing.py:106
↓ 3 callers
Function
_call_through_chain
Run a request through the processors and the backend in-process. Skips terminal translation on purpose: returning the typed :class:`ChatRespo
tests/e2e/test_llm_classifier_e2e.py:139
↓ 3 callers
Function
_chat_request
(*, user_message: str, **body_overrides: Any)
tests/e2e/test_llm_classifier_e2e.py:157
↓ 3 callers
Function
_classifier_mapping
( raw: object, defaults: Mapping[str, object], *, allowed_keys: frozenset[str], where: str
switchyard/cli/route_bundle.py:1136
↓ 3 callers
Function
_client
(base_url: str)
tests/test_stream_leak_repro.py:117
↓ 3 callers
Function
_client_for
(app)
tests/e2e/test_evict_reroute_e2e.py:82
↓ 3 callers
Function
_container_position
(line: str, quote_depth: int)
mkdocs_hooks.py:134
↓ 3 callers
Function
_ctx_with_upstream_stash
(**extra: object)
tests/test_error_source_annotation.py:76
↓ 3 callers
Function
_custom_id_config
()
tests/test_deterministic_routing_profile.py:504
↓ 3 callers
Method
_deny_if_needed
(self, flow: http.HTTPFlow)
benchmark/closed_book_proxy/proxy/rewriter.py:104
↓ 3 callers
Method
_dispatch
(self, request: ChatRequest)
tests/test_chat_request.py:167
↓ 3 callers
Method
_dispatch
(self, request: ChatRequest)
tests/test_chat_request.py:192
↓ 3 callers
Function
_extract_assistant_text
Concatenate all ``output_text`` blocks across ``output`` items. The Responses API ``output`` array is heterogeneous — it can contain ``messag
tests/e2e/test_passthrough_responses_e2e.py:80
↓ 3 callers
Function
_field
(value: object, name: str)
switchyard/lib/processors/routing_log_response_processor.py:197
↓ 3 callers
Function
_find_event
(events: list[dict], event_type: str)
tests/test_response_translation_engine.py:257
↓ 3 callers
Function
_finish_reason
(response: ChatResponse)
tests/e2e/test_llm_classifier_e2e.py:201
↓ 3 callers
Function
_frame_data
(frame: str)
tests/test_format_translate_processor.py:238
↓ 3 callers
Function
_get_winsize
(fd: int)
switchyard/server/shell_tui.py:52
↓ 3 callers
Method
_handle_winch
Perform deferred resize work scheduled by ``_on_winch``. Runs from the main loop, never from a signal handler. Steps: * Re-query the
switchyard/server/shell_tui.py:276
↓ 3 callers
Function
_int_value
(value: object, default: int)
switchyard/lib/chat_response/streaming_response_accumulator.py:747
↓ 3 callers
Function
_jsonable_mapping
(value: Any)
switchyard_rust/translation.py:425
↓ 3 callers
Function
_make_anthropic_message
(content: str = "Hi there", model: str = "claude-sonnet-4-20250514")
tests/test_response_translation_engine.py:51
↓ 3 callers
Function
_make_responses_api_response
( *, content: str = "Hello from Responses", model: str = "gpt-4o", )
tests/test_response_translation_engine.py:66
↓ 3 callers
Method
_maybe_paint_footer
Paint the footer if the child has been quiet long enough. Returns ``True`` iff a paint actually happened. Callable from unit tests as
switchyard/server/shell_tui.py:235
↓ 3 callers
Function
_mock_tool_call
( call_id: str = "call_abc", name: str = "get_weather", arguments: str = '{"location":"SF"}', )
tests/test_translation_engine_chaos.py:137
↓ 3 callers
Function
_normalize_profile_type
Validate and normalize a serialized profile type discriminator.
switchyard/lib/profiles/table.py:23
↓ 3 callers
Function
_normalized_host
(value: str | None)
benchmark/closed_book_proxy/proxy/rewriter.py:61
↓ 3 callers
Function
_openai_completion
()
tests/test_routing_log_response_processor.py:44
↓ 3 callers
Function
_optional_str
(value: object)
switchyard/cli/route_bundle.py:1327
↓ 3 callers
Function
_parse
Return ``(help_map, type_map, samples)`` from exposition text. samples keys are ``(metric_name, frozenset(labels.items()))``.
tests/test_prometheus_exposition.py:21
↓ 3 callers
Function
_path_digest
(path: Path)
benchmark/prepare_harbor_dataset.py:90
↓ 3 callers
Function
_pool_conns
Best-effort live connection count for evidence logging (version-dependent).
tests/test_stream_leak_repro.py:132
↓ 3 callers
Function
_request
(model: str = "client-model")
tests/test_random_routing_llm_backend.py:54
↓ 3 callers
Function
_request
()
tests/test_llm_classifier_presets.py:52
↓ 3 callers
Function
_response_format
(response: ChatResponse)
switchyard_rust/translation.py:315
↓ 3 callers
Function
_responses_req
()
tests/test_request_translation_engine_to_any_of.py:41
↓ 3 callers
Function
_strong_target
(api_key: str)
tests/e2e/test_evict_reroute_e2e.py:62
↓ 3 callers
Function
_weak_target
(api_key: str)
tests/e2e/test_evict_reroute_e2e.py:72
↓ 3 callers
Method
_write
(self, data: bytes)
switchyard/server/shell_tui.py:147
↓ 3 callers
Method
aclose
(self)
tests/test_stream_close_chain.py:190
↓ 3 callers
Method
acompletion
(self, **kwargs: object)
tests/test_stage_router_classifier.py:131
↓ 3 callers
Method
affinity_key
Derives the stable identity this router should retain for `request`.
crates/libsy/src/algorithms/util/affinity.rs:97
↓ 3 callers
Function
algorithm_label
The algorithm label carried by a request context; empty until stamped.
crates/libsy/src/observability.rs:66
↓ 3 callers
Function
anthropic_content_blocks
(body: &Value)
crates/switchyard-components/src/dimension_collector/response/checks.rs:162
↓ 3 callers
Method
as_footer_fn
(self)
switchyard/cli/launchers/live_stats_footer.py:50
↓ 3 callers
Function
attributes
(model: &str, tier: Option<&str>)
crates/switchyard-server/src/usage_metrics.rs:152
↓ 3 callers
Function
attributes_match
True when the data point carries every wanted `key=value` attribute.
crates/libsy/tests/observability.rs:229
↓ 3 callers
Method
backend_for
The backend serving `model` over `format` — the default backend when its format matches, otherwise a matching entry in `other_backends`; `None` when t
crates/libsy-llm-client/src/client.rs:117
↓ 3 callers
Function
banner_pause
Hold the banner on screen for up to *timeout* seconds. Returns early if the user presses any key. Only call when stdin is a TTY.
switchyard/cli/launchers/launcher_runtime.py:287
↓ 3 callers
Function
build_rl_logging_processors
Request/response processor lists for local RL trace logging. Returns ``([], [])`` when ``rl_log_dir`` is ``None`` (logging disabled), or the
switchyard/lib/processors/rl_logging_response_processor.py:132
↓ 3 callers
Function
build_tier_passthrough_switchyard
Build a single-tier chain for an explicitly selected model.
switchyard/lib/route_table_builders.py:93
↓ 3 callers
Method
call
Execute one request through the branch its headers select.
switchyard/lib/profiles/subagent_override.py:48
↓ 3 callers
Method
call
Run the compatibility chain and translate the final response.
switchyard_rust/core.py:497
↓ 3 callers
Function
classify
Map an HTTP status code to its outcome bucket. 2xx → ``success``. The codes listed in :data:`RETRYABLE_STATUSES` (429 / 500 / 504) → ``retrya
switchyard/lib/endpoints/outcome_metrics.py:109
↓ 3 callers
Method
classify
(self, **_: Any)
tests/test_llm_classifier_presets.py:202
↓ 3 callers
Function
clone_callbacks
(callbacks: &Arc<Mutex<Vec<Py<PyAny>>>>)
crates/switchyard-py/src/interop/response.rs:579
↓ 3 callers
Method
clone_core
(&self, py: Python<'_>)
crates/switchyard-py/src/libsy_bindings.rs:65
↓ 3 callers
Function
close_anthropic_reasoning_block
Closes an open Anthropic thinking block before text/tool content starts.
crates/switchyard-translation/src/codecs/anthropic/stream.rs:418
↓ 3 callers
Method
coding_agent_default
The coding-agent-launcher default trio. Strong: Claude Opus 4.7. Weak: Kimi K2.6. Classifier: Gemini 3.5 Flash. Profi
switchyard/lib/profiles/deterministic_routing_presets.py:54
↓ 3 callers
Function
completion_text
Returns a lossy text view of the first assistant output. Only text blocks from the first output are concatenated. Refusals, reasoning, tools, media,
crates/protocol/src/lib.rs:70
↓ 3 callers
Function
config
(base_url: &str)
crates/libsy-llm-client/src/backend.rs:205
↓ 3 callers
Function
configure_debug_file_logging
Move launcher diagnostics to a per-run debug log and return its path.
switchyard/cli/launchers/launcher_runtime.py:36
↓ 3 callers
Function
counting_overflow_targets
( names: &[&str], overflowing: &[&'static str], calls: Arc<Mutex<Vec<String>>>, )
crates/libsy/src/algorithms/fall_through.rs:902
↓ 3 callers
Function
critical
The signal that forces an escalation on the override path.
crates/libsy/src/algorithms/util/stage.rs:782
↓ 3 callers
Method
decode_event
( &self, state: &mut StreamTranslationState, event: &Value, )
crates/switchyard-translation/src/codecs/anthropic/stream.rs:24
↓ 3 callers
Function
decode_image_source
Decodes OpenAI image block shapes into normalized image sources.
crates/switchyard-translation/src/codecs/openai_chat/buffered.rs:504
↓ 3 callers
Method
decode_request
( &self, body: &Value, policy: &TranslationPolicy, )
crates/switchyard-translation/tests/extension_points.rs:152
↓ 3 callers
Function
dispatch_chat_request
Dispatch one request through the configured app state. Single-chain apps return already-translated Python payloads because ``Switchyard`` sti
switchyard/lib/endpoints/dispatch.py:47
↓ 3 callers
Function
encode_aggregated_response
Encodes a buffered aggregate into `wire_format`'s JSON body, stamping `served_model` over the encoded id so the caller sees which model answered. Pass
crates/switchyard-translation/src/helpers.rs:54
↓ 3 callers
Function
encode_anthropic_stream
Encodes neutral streaming events into Anthropic Messages events.
crates/switchyard-translation/src/codecs/anthropic/stream.rs:146
↓ 3 callers
Function
escalation_router
Builds a router with escalation enabled (`confirmations=1` latches on the first verdict).
crates/libsy/src/algorithms/llm_class.rs:1806
↓ 3 callers
Function
estimate_model_cost
( model: &str, prompt_tokens: u64, completion_tokens: u64, cached_tokens: u64, cache_creat
crates/switchyard-components/src/stats/cost.rs:73
↓ 3 callers
Method
exclude_target
Excludes a target from this request, returning whether it was newly excluded. Re-excluding returns `false`, which is what bounds the overflow retry on
crates/protocol/src/envelope.rs:25
↓ 3 callers
Function
extract_caller_api_key
Pull the caller-supplied API key out of an HTTP request's headers. Precedence: the dedicated ``x-switchyard-api-key`` header first, then ``Au
switchyard/lib/request_metadata.py:100
↓ 3 callers
Function
extract_response_signals
Runs all four checks against a buffered `ChatResponse` and returns the set of failing flags. Streaming responses (where [`ChatResponse::body`] return
crates/switchyard-components/src/dimension_collector/response/mod.rs:76
↓ 3 callers
Method
first_output
Returns the first output item when a response has any output.
crates/protocol/src/llm.rs:452
↓ 3 callers
Function
fold
(chunks: Vec<LlmResponseChunk>)
crates/protocol/src/stream.rs:450
↓ 3 callers
Function
format_number
(value: float | int)
switchyard/lib/prometheus_exposition.py:209
↓ 3 callers
Function
handle_endpoint
( state: ServerState, started: RequestStart, headers: HeaderMap, body: std::result::Result<Jso
crates/switchyard-server/src/lib.rs:550
↓ 3 callers
Function
http_outcome_label
(status: Option<u16>)
crates/libsy-llm-client/src/metrics.rs:12
↓ 3 callers
Method
into_body
Consumes the wrapper and returns the JSON request body.
crates/switchyard-components/src/contracts/types.rs:49
↓ 3 callers
Function
invalid_body_error
(message: impl Into<String>)
crates/switchyard-server/src/lib.rs:988
↓ 3 callers
Function
is_known_role_name
Returns whether a role name is recognized by a supported provider API.
crates/switchyard-translation/src/codecs/common.rs:11
↓ 3 callers
Function
is_overflow_body
Detect a context-overflow body using a provider-supplied structured check and substring phrase list. See module docs for the matching strategy.
crates/switchyard-components/src/backends/context_overflow.rs:18
↓ 3 callers
Function
load_server_state
Loads a TOML deployment file and constructs the complete server state.
crates/switchyard-server/src/config.rs:30
↓ 3 callers
Function
make_ctx
()
tests/test_infra.py:26
↓ 3 callers
Method
make_tier_selector_config
Return a :class:`SignalTierSelectorConfig` with this profile's mapping.
switchyard/lib/processors/llm_classifier/presets.py:290
↓ 3 callers
Function
message_text
Flatten a chat message (or Responses item) to plain text, tool calls included.
switchyard/lib/processors/message_condensing.py:92
↓ 3 callers
Method
on_complete
Run a callback once after normal stream exhaustion.
switchyard_rust/core.py:145
↓ 3 callers
Function
openai_endpoint
Builds a passthrough OpenAI endpoint fixture.
crates/switchyard-components/tests/adversarial_native_backends.rs:117
↓ 3 callers
Function
openai_first_choice
(body: &Value)
crates/switchyard-components/src/dimension_collector/response/checks.rs:147
↓ 3 callers
Function
parse_json_sse_frame
Parses data lines from one SSE frame into JSON, terminal, or empty states.
crates/switchyard-components/src/backends/common.rs:110
↓ 3 callers
Function
parse_json_verdict
(response: &AggLlmResponse)
crates/libsy/src/algorithms/util/llm_judge.rs:317
↓ 3 callers
Method
prefix_eligibility
Returns the cache-eligible fraction for `model` and records the prefix as seen.
crates/switchyard-server/src/stats/accumulator.rs:148
↓ 3 callers
Function
preserved_body
()
crates/libsy/src/algorithms/util/prompts.rs:162
↓ 3 callers
Function
print_session_summary
Print a session summary to stdout after the launcher exits.
switchyard/cli/launchers/session_summary.py:20
← previous
next →
501–600 of 4,886, ranked by callers