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
↓ 9 callers
Function
pick_efficient_first
EFFICIENT default. CAPABLE only when the scorer is confidently positive.
switchyard/lib/processors/stage_router/picker.py:44
↓ 9 callers
Method
record_classifier_usage
Records one LLM-classifier overhead call. The classifier's per-request call is not part of the routed-backend chain and must stay out of `by_model` —
crates/switchyard-components/src/stats/accumulator.rs:237
↓ 9 callers
Method
respond_json
(self, body: dict[str, object], *, status: int = 200)
tests/_chain_test_helpers.py:213
↓ 9 callers
Method
score
( &self, state: &mut State, request: &mut Request, _driver: Option<&Driver>,
crates/libsy/src/algorithms/util/stage.rs:483
↓ 9 callers
Method
set_selected_target
Replaces the selected target, returning the previous target.
crates/switchyard-components/src/contracts/context.rs:55
↓ 9 callers
Method
start
()
crates/switchyard-server/tests/server.rs:44
↓ 9 callers
Function
test_config
(base_threshold: f64)
crates/libsy/src/algorithms/llm_class.rs:968
↓ 9 callers
Function
test_error
(message: &'static str)
crates/libsy/src/core/algorithm.rs:845
↓ 9 callers
Method
text
(&self)
crates/switchyard-server/tests/server.rs:613
↓ 9 callers
Method
with
Hand `target` this prompt on every turn it serves.
crates/libsy/src/algorithms/util/prompts.rs:82
↓ 8 callers
Function
_build_parser
()
switchyard/cli/switchyard_cli.py:107
↓ 8 callers
Function
_fake_response
(status_code: int)
tests/test_anthropic_probe.py:25
↓ 8 callers
Function
_json_copy
Normalize an object to an owned JSON value.
switchyard_rust/core.py:46
↓ 8 callers
Function
_make_openai_client
Build an OpenAI SDK client pointed at the passthrough server. The passthrough server injects its own upstream ``api_key`` into calls it makes
tests/e2e/test_passthrough_e2e.py:58
↓ 8 callers
Function
_make_openai_client
Build an OpenAI SDK client pointed at the passthrough server. Same convention as the Chat Completions sibling — the passthrough injects its o
tests/e2e/test_passthrough_responses_e2e.py:64
↓ 8 callers
Function
_populated_ctx
(messages: list[dict])
tests/test_stage_router_request_processor.py:37
↓ 8 callers
Method
as_str
Returns the stable string identifier for a built-in format.
crates/protocol/src/format.rs:27
↓ 8 callers
Method
build
Build this config into a concrete profile runtime.
switchyard/lib/profiles/protocols.py:101
↓ 8 callers
Method
call_rewrite_model_raw
The whole decode → call → encode path a wire endpoint needs, in one call. Decodes `raw_http_request` from `wire_format` to the neutral IR, serves it
crates/libsy-llm-client/src/client.rs:460
↓ 8 callers
Function
classify_text
Match `text` against the error pattern table. Returns `(max_severity, matched_pattern_names)`.
crates/libsy/src/algorithms/util/tool_signals.rs:530
↓ 8 callers
Method
coding_agent_2_tier
Claude Code / Codex / Cursor traffic; SIMPLE+MEDIUM→weak. Routine turns inside an agentic session (single-line edits, file exploratio
switchyard/lib/processors/llm_classifier/presets.py:345
↓ 8 callers
Function
error_response
( status: StatusCode, message: impl Into<String>, error_type: &'static str, code: &'static str
crates/switchyard-server/src/lib.rs:997
↓ 8 callers
Method
fail
Terminate the stream with an error item — the producer-side way to surface a failure to the consumer (mirrors how the crate's `run_stream` yields an `
crates/libsy/src/core/driver.rs:229
↓ 8 callers
Function
gateway_response
(model: str = "moonshotai/kimi-k3")
examples/experimental/litellm/tests/test_client.py:37
↓ 8 callers
Method
json
(&self)
crates/switchyard-server/tests/server.rs:609
↓ 8 callers
Method
load
(&self, _namespace: &SkillNamespace)
crates/switchyard-skill-distillation/tests/contracts.rs:135
↓ 8 callers
Function
load_test_config
(toml: &str)
crates/switchyard-server/tests/server.rs:530
↓ 8 callers
Function
make_anthropic_content_delta
(*, text: str = "hi")
tests/test_chat_response.py:89
↓ 8 callers
Method
model
Reads the request's `model` field when present and string-valued.
crates/switchyard-components/src/contracts/types.rs:132
↓ 8 callers
Function
openai_responses
( State(state): State<ServerState>, Extension(started): Extension<RequestStart>, headers: HeaderMa
crates/switchyard-server/src/lib.rs:503
↓ 8 callers
Function
orch
Build a shared `TestAlgo` over the given target set.
crates/libsy/src/core/algorithm.rs:977
↓ 8 callers
Method
process
(self, ctx: ProxyContext, request: ChatRequest)
switchyard/lib/processors/stage_router_request_processor.py:79
↓ 8 callers
Method
register
(self, app: FastAPI)
tests/test_build_and_serve.py:88
↓ 8 callers
Method
replace_body
Replace the body without changing its wire format.
switchyard_rust/core.py:110
↓ 8 callers
Function
request_body
()
tests/test_libsy_minimal_bindings.py:13
↓ 8 callers
Method
request_type
Returns the request's tagged wire format.
crates/switchyard-components/src/contracts/types.rs:105
↓ 8 callers
Method
respond_json
(self, status: int, body: dict[str, object])
tests/test_passthrough_profile_e2e.py:151
↓ 8 callers
Function
state_with
A `State` carrying `signal` as its tool signals.
crates/libsy/src/algorithms/util/stage.rs:608
↓ 8 callers
Method
with_prompt
Overrides the packaged classifier prompt.
crates/libsy/src/algorithms/util/classifier_contract.rs:23
↓ 7 callers
Function
_anthropic
Anthropic request whose trailing user turn carries a tool_result block.
tests/test_stage_router_handoff_notes.py:22
↓ 7 callers
Method
_client_with_spied_options
()
tests/test_llm_client.py:44
↓ 7 callers
Function
_coding_signals
( *, tool_call_count_estimate: int = 0, turn_type: CodingAgentTurnType = CodingAgentTurnType.EXPLO
tests/test_signal_tier_selector_request_processor.py:362
↓ 7 callers
Function
_completion
(*, content: str | None = "hi there", tool_calls: list | None = None, choices: list | None = N
tests/test_rl_logging.py:54
↓ 7 callers
Function
_emit_and_parse
Call the logger and return the single emitted record parsed as JSON.
tests/test_upstream_error_log.py:23
↓ 7 callers
Function
_format_name
(value: str | ChatRequestType)
switchyard_rust/translation.py:295
↓ 7 callers
Function
_msg_tool_result
(content: str)
tests/test_stage_router_pickers.py:46
↓ 7 callers
Function
_no_probe
(name: str)
tests/test_backend_format_resolver.py:27
↓ 7 callers
Function
_require_mapping
(value: object, where: str)
switchyard/cli/route_bundle.py:1304
↓ 7 callers
Function
_run
(log_dir: Path, response: ChatResponse, *, snapshot: bool = True)
tests/test_rl_logging.py:79
↓ 7 callers
Function
_selection
Recorded route selection, with *overrides* applied.
tests/test_route_selection_headers.py:36
↓ 7 callers
Function
apply_deepseek_overrides
Apply benchmark-specific DeepSeek extras without clobbering callers.
switchyard/lib/profiles/tier_target_builders.py:29
↓ 7 callers
Method
aresponses
Async wrapper for the OpenAI Responses API. When a non-blank ``api_key`` is supplied, the call uses that per-request credential via t
switchyard/lib/llm_client.py:110
↓ 7 callers
Function
build_multi_llm_backend
Build a Rust ``MultiLlmBackend`` from configured targets.
switchyard/lib/backends/multi_llm_backend.py:62
↓ 7 callers
Method
call
( self, ctx: ProxyContext, request: ChatRequest, )
switchyard/lib/backends/anthropic_cache_breakpoint_backend.py:101
↓ 7 callers
Function
chat_map_with_retries
(base_url: &str, max_retries: u32)
crates/libsy-llm-client/src/client.rs:862
↓ 7 callers
Function
coerce_llm_target
Build a Rust ``LlmTarget`` from a target object or legacy mapping.
switchyard/lib/backends/llm_target.py:17
↓ 7 callers
Method
decode_stream_event
Decodes one provider event while retaining its parsed source JSON value. Takes ownership of `event` so preservation does not deep-copy provider JSON
crates/switchyard-translation/src/engine.rs:253
↓ 7 callers
Method
error
Creates a fake backend that returns one error.
crates/switchyard-components/tests/stats_processors.rs:59
↓ 7 callers
Function
handle_chain_exception
Handle an unexpected chain exception: check for upstream status, log, and return envelope.
switchyard/lib/endpoints/upstream_error.py:189
↓ 7 callers
Method
header
Returns a header value using case-insensitive matching.
crates/switchyard-components/tests/support/mod.rs:34
↓ 7 callers
Method
local_addr
Returns the actual bound address, including an OS-selected port.
crates/switchyard-server/src/lib.rs:300
↓ 7 callers
Method
name
(&self)
crates/libsy/tests/observability.rs:455
↓ 7 callers
Method
registered_models
Return registered model ids in registration order.
switchyard/lib/route_table.py:87
↓ 7 callers
Function
request
()
crates/libsy/src/algorithms/rand.rs:205
↓ 7 callers
Function
route_selection_headers
Response headers for the route selection recorded on *ctx*, if any. Empty when no routing backend recorded a selection (passthrough chains, f
switchyard/lib/endpoints/route_selection.py:52
↓ 7 callers
Method
run
Start the child and block until it exits. Returns its exit code.
switchyard/server/shell_tui.py:316
↓ 7 callers
Method
run_stream
Process a request to completion, returning a stream of [`Step`]s. The consumer must fulfill every [`Step::CallLlm`] before the algorithm can continue
crates/libsy/src/core/algorithm.rs:650
↓ 7 callers
Function
scores
Scores through the definitive classification variant used by affinity.
crates/libsy/src/algorithms/util/affinity.rs:305
↓ 7 callers
Function
serialize_chain_result
Serialize a chain result to the appropriate HTTP response. Returns the result itself if it is already a ``Response``, wraps it in a ``Streami
switchyard/lib/endpoints/dispatch.py:95
↓ 7 callers
Function
serialize_test
The tests in this file must not overlap because metrics are global. There is no Rust/cargo-native way of saying this (people use `serial_test` crate)
crates/libsy/tests/observability.rs:209
↓ 7 callers
Method
set_model
Set the request model, replacing a malformed non-object body.
switchyard_rust/core.py:104
↓ 7 callers
Method
status
(&self)
crates/libsy-llm-client/src/client.rs:546
↓ 7 callers
Function
strip_v1_suffix
Return *base_url* with a trailing ``/v1`` path component removed. Switchyard's ``--base-url`` convention follows OpenAI's (e.g. ``https://ope
switchyard/lib/backends/backend_format_resolver.py:292
↓ 7 callers
Function
target_set
`(name, has_client)` — `has_client: false` builds a target with no default client.
crates/libsy/src/core/algorithm.rs:990
↓ 7 callers
Function
telemetry
()
crates/libsy/tests/observability.rs:175
↓ 6 callers
Function
_anthropic_target
(**overrides: object)
tests/test_anthropic_native_llm_backend.py:15
↓ 6 callers
Function
_async_iter
(items: list)
tests/test_response_translation_engine.py:240
↓ 6 callers
Function
_backend_payload
(*, content: str, model: str)
tests/_chain_test_helpers.py:88
↓ 6 callers
Function
_capture_uvicorn
Patch ``uvicorn.run`` to capture its kwargs without starting a server.
tests/test_build_and_serve.py:110
↓ 6 callers
Function
_chat_response_to_responses
(response: object)
tests/test_responses_openai_translation.py:19
↓ 6 callers
Function
_chunk
Build a minimal OpenAI-shaped streaming chunk.
tests/test_response_translation_engine.py:220
↓ 6 callers
Function
_ctx
(*, headers: dict[str, str] | None = None, model: str = "gpt-test")
tests/test_routing_log_response_processor.py:36
↓ 6 callers
Method
_dispatch
(self, response: ChatResponse)
tests/test_chat_response.py:260
↓ 6 callers
Function
_mock_completion
Build a MagicMock that quacks like ``ChatCompletion``.
tests/test_translation_engine_chaos.py:86
↓ 6 callers
Function
_ns
Build the argparse namespace ``build_and_serve`` expects.
tests/test_build_and_serve.py:103
↓ 6 callers
Function
_read_only_trace
(log_dir: Path)
tests/test_rl_logging.py:73
↓ 6 callers
Function
_records
(log_file: Path)
tests/test_routing_log_response_processor.py:112
↓ 6 callers
Function
_request
(*, msg: str = "hi")
tests/test_python_profile_abstractions.py:153
↓ 6 callers
Function
_switchyard
()
tests/test_build_and_serve.py:124
↓ 6 callers
Function
_tier
(model: str = "m")
tests/test_random_routing_config.py:123
↓ 6 callers
Function
_two_tier_config
Config mapping COMPLEX/REASONING→strong, SIMPLE/MEDIUM/default→weak.
tests/test_signal_tier_selector_request_processor.py:75
↓ 6 callers
Function
_upstream_count
(out: str, outcome: str, code: str)
tests/test_outcome_metrics.py:187
↓ 6 callers
Function
_write_closed_book_dataset
(path: Path)
tests/test_run_baseline_script.py:237
↓ 6 callers
Function
build_passthrough_table
Build a table of passthrough chains for *tiers* and their catalogs. For each tier this: 1. Registers the tier's configured model as a direct
switchyard/lib/route_table_builders.py:137
↓ 6 callers
Method
call_llm_target
Offload a call to `target`: pair `request` with `decision` and the target's default client into a [`RoutedRequest`], then publish it (see [`call_llm`]
crates/libsy/src/core/algorithm.rs:260
↓ 6 callers
Method
close
Gracefully stop the native server.
switchyard/cli/launchers/native_server.py:51
↓ 6 callers
Method
config
Shared HTTP config, regardless of variant.
crates/libsy-llm-client/src/backend.rs:90
↓ 6 callers
Method
default_model
Return the advertised default model id, falling back to first entry.
switchyard/lib/route_table.py:97
↓ 6 callers
Function
embed_preservation
Embeds preservation metadata into a translated wire body when requested.
crates/switchyard-translation/src/util.rs:275
↓ 6 callers
Function
error_response
Build a JSONResponse with Switchyard's normalized error envelope. Stamps the failure-source headers: every direct caller synthesizes a Switch
switchyard/lib/endpoints/error_envelope.py:49
← previous
next →
201–300 of 4,886, ranked by callers