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
↓ 6 callers
Method
finish
Finishes target-provider stream emission after the source stream closes.
crates/switchyard-translation/src/codecs/stream.rs:205
↓ 6 callers
Function
iter_chat_completion_sse
Serialize a Chat Completions chunk stream to OpenAI-style SSE frames. Accepts any async iterator of objects with ``model_dump()`` (OpenAI SDK
switchyard/lib/endpoints/sse_helpers.py:59
↓ 6 callers
Method
make_classifier_config
Return an :class:`LLMClassifierConfig` with this profile's prompt baked in. ``disable_reasoning=None`` (default) auto-detects from ``model``
switchyard/lib/processors/llm_classifier/presets.py:249
↓ 6 callers
Function
make_responses_text_delta
(*, delta: str = "hi")
tests/test_chat_response.py:132
↓ 6 callers
Method
noop
(chunk: ChatCompletionChunk)
tests/test_chat_response.py:410
↓ 6 callers
Method
now
Captures the current monotonic clock instant.
crates/switchyard-components/src/stats/context.rs:20
↓ 6 callers
Method
process
Extracts the tool-result signal and stores it on the request context.
crates/switchyard-components/src/request_processors/dimension_collector.rs:46
↓ 6 callers
Function
provider_extensions
Copies unknown provider fields into the IR extension map.
crates/switchyard-translation/src/codecs/common.rs:45
↓ 6 callers
Method
record
(&mut self, latency_ms: f64)
crates/switchyard-server/src/stats/accumulator.rs:302
↓ 6 callers
Function
record_upstream_attempt_failure
Record one failed ``switchyard_upstream_attempts_total`` when attributable. Counts an attempt only for failures attributable to the upstream call
switchyard/lib/endpoints/upstream_error.py:64
↓ 6 callers
Function
recording_router
( client: Arc<RecordingClient>, config: StageRouterConfig, )
crates/libsy/src/algorithms/stage.rs:423
↓ 6 callers
Function
render_prometheus
Render a stats snapshot as Prometheus text-format exposition. Args: snapshot: The dict returned by :meth:`StatsAccumulator.snapshot_sync`
switchyard/lib/prometheus_exposition.py:41
↓ 6 callers
Function
request
()
crates/libsy/src/algorithms/fall_through.rs:679
↓ 6 callers
Function
response_type_value
Normalize response-format tags and wire strings.
switchyard_rust/core.py:662
↓ 6 callers
Function
run_turn
Drives a shared router through one turn in the default test session.
crates/libsy/src/algorithms/fall_through.rs:713
↓ 6 callers
Method
safe_load
(self, stream: str)
switchyard/cli/route_bundle.py:308
↓ 6 callers
Method
shutdown
(self)
tests/test_switchyard_app_lifecycle.py:38
↓ 6 callers
Function
sse_frame_payloads
Parse an SSE frame string into its JSON ``data:`` payload(s). Follows the SSE contract: a frame's ``data:`` lines are joined with newlines to
switchyard_rust/translation.py:443
↓ 6 callers
Method
target_ids
(&self)
crates/switchyard-py/src/component_bindings/backends.rs:227
↓ 6 callers
Function
tiers
Tiers named the way a deployment would name them.
crates/libsy/src/algorithms/util/stage.rs:603
↓ 6 callers
Method
translate_stream
Translate an async stream between provider event formats. Closes *stream* on every exit path. When the client disconnects, the ASGI s
switchyard_rust/translation.py:215
↓ 6 callers
Function
turn_request
(failed: bool)
crates/libsy/src/algorithms/stage.rs:454
↓ 6 callers
Method
validate
( &self, candidate: &SkillCandidate, evaluation: &[Trajectory], )
crates/switchyard-skill-distillation/tests/contracts.rs:154
↓ 6 callers
Method
with_name
Sets the stable, low-cardinality telemetry name for this composition.
crates/libsy/src/algorithms/fall_through.rs:173
↓ 5 callers
Method
__anext__
(self)
tests/test_stream_close_chain.py:54
↓ 5 callers
Function
_aclose_stream
Best-effort close of an upstream response stream. On every exit path — normal completion, mid-stream error, or the client disconnecting (whic
switchyard/lib/endpoints/sse_helpers.py:36
↓ 5 callers
Function
_anthropic_req
()
tests/test_request_translation_engine_to_any_of.py:33
↓ 5 callers
Function
_backend
Build the deterministic profile and return its dispatch backend.
tests/test_deterministic_routing_cache_wrapping.py:71
↓ 5 callers
Function
_c
(code: str, text: str, enabled: bool)
switchyard/cli/launchers/launcher_runtime.py:178
↓ 5 callers
Function
_config
( *, strong_format: BackendFormat, weak_format: BackendFormat = BackendFormat.OPENAI, enable_s
tests/test_deterministic_routing_cache_wrapping.py:29
↓ 5 callers
Function
_config_path
Resolve the selected deployment, defaulting to the packaged OpenRouter config.
switchyard/cli/launch_command.py:14
↓ 5 callers
Function
_config_with_escalation
(escalate: bool)
tests/test_signal_tier_selector_request_processor.py:380
↓ 5 callers
Function
_footer
(stats: StatsAccumulator, *, model: str = "nvidia/some/default")
tests/test_live_stats_footer.py:58
↓ 5 callers
Function
_openai_req
()
tests/test_request_translation_engine_to_any_of.py:26
↓ 5 callers
Function
_request
()
tests/test_rl_logging.py:33
↓ 5 callers
Function
_responses_items_to_messages
(items: list)
tests/test_codex_multiturn_traces.py:29
↓ 5 callers
Function
_routed_ctx
A context shaped like one a router leaves behind for the terminal role.
tests/test_response_translation_engine.py:270
↓ 5 callers
Function
_strip_unsupported_output_config
Drop ``output_config.format`` from an inbound Anthropic body in place. Claude Code 2.1.1x sends ``output_config.format`` (a structured-output
switchyard/lib/endpoints/anthropic_messages_endpoint.py:50
↓ 5 callers
Function
_stub_classifier
(tier: str | None)
tests/test_stage_router_pickers.py:82
↓ 5 callers
Function
_system_messages
(result: dict)
tests/test_anthropic_openai_translation.py:28
↓ 5 callers
Function
_target_value
( raw: object, defaults: Mapping[str, object], default_id: str, where: str, )
switchyard/cli/route_bundle.py:1122
↓ 5 callers
Function
_translate_anthropic_request_to_openai
( *, messages: Iterable[Mapping[str, Any]], **kwargs: Any, )
tests/test_anthropic_openai_translation.py:16
↓ 5 callers
Function
algo
(name: &str, model: &str, client: Option<Arc<dyn RoutedLlmClient>>)
crates/libsy/tests/observability.rs:498
↓ 5 callers
Function
algorithm
Builds a random router whose targets all share an echo client.
crates/libsy/src/algorithms/rand.rs:235
↓ 5 callers
Function
append_note
Appends `note` to the request as conversation text. It joins the trailing user message when there is one, rather than opening a turn of its own: Anth
crates/libsy/src/algorithms/util/prompts.rs:42
↓ 5 callers
Function
assert_in_order
(haystack: &str, needles: &[&str])
crates/switchyard-server/tests/server.rs:640
↓ 5 callers
Function
attach_request_metadata
Attach request metadata and redacted headers to the Python context.
switchyard/lib/request_metadata.py:59
↓ 5 callers
Method
build_request
(&self, state: &State, request: &Request)
crates/libsy/src/algorithms/util/llm_judge.rs:146
↓ 5 callers
Method
call
(self, ctx, request)
tests/test_infra.py:69
↓ 5 callers
Function
collect_json_events
Drains JSON stream events and rejects unexpected text frames.
crates/switchyard-components/tests/adversarial_native_backends.rs:144
↓ 5 callers
Function
config
()
crates/libsy/src/algorithms/stage.rs:312
↓ 5 callers
Function
config_with_judge
(client: &Arc<RecordingClient>, p_solve: f64)
crates/libsy/src/algorithms/stage.rs:440
↓ 5 callers
Function
context_exhausted_response
Translate :class:`SwitchyardContextPoolExhaustedError` into a 400. Raised by the chain executor when every routing target has been evicted af
switchyard/lib/endpoints/upstream_error.py:219
↓ 5 callers
Method
decode
( &self, response: &AggLlmResponse, _contract: &ClassifierContract, )
crates/libsy/src/algorithms/util/llm_judge.rs:62
↓ 5 callers
Function
decode_stream
Decodes a byte stream of `source`-format SSE frames into neutral IR chunks. Operates on raw bytes, not any HTTP client type: the caller adapts its tr
crates/switchyard-translation/src/helpers.rs:174
↓ 5 callers
Method
default_model
(self)
tests/test_rl_logging.py:316
↓ 5 callers
Function
embed_policy
Builds the policy used by exact wire round-trip tests.
crates/switchyard-translation/tests/lossless_roundtrip.rs:244
↓ 5 callers
Method
encode_stream_event
Encodes one neutral or preserved stream event for a target provider. A preserved event replays its retained JSON value unchanged when its source and
crates/switchyard-translation/src/engine.rs:271
↓ 5 callers
Function
ensure_responses_created
Emits the initial Responses created event once per stream.
crates/switchyard-translation/src/codecs/responses/stream.rs:389
↓ 5 callers
Method
ensure_started
(&self)
crates/libsy/src/core/driver.rs:146
↓ 5 callers
Function
find_span
(spans: &[SpanRecord], name: &str, field: &str, value: &str)
crates/libsy/tests/observability.rs:540
↓ 5 callers
Method
from_config
Create a profile config from the validated parsing model.
switchyard/lib/profiles/stage_router.py:36
↓ 5 callers
Function
get_telemetry_headers
Return headers to attach to outbound LLM SDK clients. Returns an empty dict when telemetry is opted out, so callers can pass or merge the res
switchyard/telemetry.py:56
↓ 5 callers
Function
json_string
Serializes JSON values into provider argument strings.
crates/switchyard-translation/src/util.rs:104
↓ 5 callers
Function
make_anthropic_message
( *, model: str = "claude-sonnet-4-20250514", text: str = "hello" )
tests/test_chat_response.py:75
↓ 5 callers
Function
make_completion
(*, model: str = "gpt-4o", content: str = "hello")
tests/test_chat_response.py:34
↓ 5 callers
Function
make_responses_api_response
( *, model: str = "gpt-4o", text: str = "hello" )
tests/test_chat_response.py:107
↓ 5 callers
Function
model_accepts_reasoning_hint
Whether ``model`` tolerates the vLLM ``enable_thinking=False`` hint. ``False`` for Anthropic/Bedrock/Claude ids (they 400 on it), else ``True``
switchyard/lib/processors/reasoning_hint.py:13
↓ 5 callers
Method
model_stats_mut
(&mut self, model: String)
crates/switchyard-server/src/stats/accumulator.rs:192
↓ 5 callers
Method
openclaw_2_tier
OpenClaw personal-assistant traffic; SIMPLE+MEDIUM→weak. Casual chitchat, lookups, light memory recall route to the weak tier; tool o
switchyard/lib/processors/llm_classifier/presets.py:377
↓ 5 callers
Method
parse
(&self, response: &AggLlmResponse)
crates/libsy/src/algorithms/util/llm_judge.rs:168
↓ 5 callers
Method
process
Stamp the tier for this turn and maybe escalate. Leaves the request unchanged.
switchyard/lib/processors/escalation_judge_request_processor.py:226
↓ 5 callers
Function
request
A one-user-turn request, the thing a note gets spliced into.
crates/libsy/src/algorithms/util/stage.rs:764
↓ 5 callers
Function
request_type_enum
Normalize a request-format tag to the Python enum.
switchyard_rust/core.py:640
↓ 5 callers
Function
request_with_metadata
(session_id: &str, correlation_id: &str)
crates/libsy/tests/observability.rs:482
↓ 5 callers
Method
run
Execute the complete Profile protocol lifecycle with a derived context.
switchyard/lib/profiles/chain.py:194
↓ 5 callers
Function
server_error
(message: impl Into<String>)
crates/switchyard-server/src/lib.rs:979
↓ 5 callers
Method
spans
(&self)
crates/libsy/tests/observability.rs:80
↓ 5 callers
Function
text_from_blocks
Extracts text-like blocks and joins them for text-only provider fields.
crates/switchyard-translation/src/codecs/common.rs:19
↓ 5 callers
Method
to_dict
Return a plain dictionary representation.
switchyard_rust/profiles.py:58
↓ 5 callers
Function
trajectory
()
crates/switchyard-skill-distillation/src/model.rs:536
↓ 5 callers
Method
translate
( self, ctx: ProxyContext, request: ChatRequest, response: ChatResponse, )
tests/test_switchyard.py:202
↓ 5 callers
Function
usage_from_body
Extracts usage from a buffered response body.
crates/switchyard-components/src/stats/usage.rs:35
↓ 5 callers
Function
wait_for_proxy_ready
Probe ``GET /health`` until HTTP 200 or timeout.
switchyard/cli/launchers/launcher_runtime.py:21
↓ 5 callers
Method
with_default_target
Sets the target used when no router selected a target.
crates/switchyard-components/src/backends/multi.rs:97
↓ 4 callers
Method
__anext__
(self)
tests/test_sse_stream_close.py:42
↓ 4 callers
Function
_breaker_affinity
(l2: _FlakyL2, clock: _Clock)
tests/test_session_affinity.py:202
↓ 4 callers
Function
_build_classifier
Build the optional LLM fallback classifier for stage_router routing.
switchyard/lib/profiles/stage_router.py:102
↓ 4 callers
Method
_build_footer_bytes
Render the footer as a single escape-sequence blob (no I/O). Order matters: * ``DECSC`` first — saves the child's cursor + SGR attrs
switchyard/server/shell_tui.py:154
↓ 4 callers
Function
_chat_chunk
( *, content: str | None = None, finish_reason: str | None = None, )
tests/test_format_translate_processor.py:44
↓ 4 callers
Function
_chunks
()
tests/test_stream_close_chain.py:80
↓ 4 callers
Function
_classifier_payload
An OpenAI Chat Completion JSON body whose content is the classifier output.
tests/_chain_test_helpers.py:47
↓ 4 callers
Function
_collect_events
(chunks: list)
tests/test_response_translation_engine.py:245
↓ 4 callers
Function
_collect_responses_stream_events
Drain a Responses API stream and summarize events. Returns ``(event_types, text, function_calls)``: * ``event_types`` — the ``type`` field o
tests/e2e/test_passthrough_responses_e2e.py:116
↓ 4 callers
Function
_collect_sdk_stream_deltas
Aggregate deltas from an OpenAI SDK ``ChatCompletionChunk`` stream. Reassembles fragmented fields across chunks using the OpenAI streaming co
tests/e2e/test_passthrough_e2e.py:87
↓ 4 callers
Function
_completion_payload
An OpenAI Chat Completion JSON body (non-streaming).
tests/test_passthrough_profile_e2e.py:46
↓ 4 callers
Function
_compose
(work_dir: Path, project: str, *args: str, timeout: int = 30)
tests/e2e/test_closed_book_proxy_integration.py:56
↓ 4 callers
Function
_config_with_alignment
( *, enabled: bool, min_conf: float = 0.7, )
tests/test_signal_tier_selector_request_processor.py:569
↓ 4 callers
Method
_drain
Drain ``master_fd`` non-blocking and write the batch to stdout. Returns ``False`` if the child closed (EIO or EOF), else ``True``. T
switchyard/server/shell_tui.py:196
↓ 4 callers
Function
_last_user_text
(request: ChatRequest)
tests/test_stage_router_handoff_notes.py:36
← previous
next →
301–400 of 4,886, ranked by callers