Skip to content

Blocking API

Make synchronous LLM calls without async runtime

Call LLMs synchronously from any Rust code — no async runtime required, no await syntax, no tokio dependency to manage.

Community — runs on the OSS / Community SDK edition.

Difficulty: Starter 🟢 · LLM

  • Summary: Synchronous blocking API for simpler use cases
  • Scenario: Make synchronous LLM calls without async runtime
  • tech_tags in manifest: LLM — example id blocking-api in conformance/examples_manifest.json.
  • SDK: Use an installed SDK tree (NXUSKIT_SDK_DIR, NXUSKIT_LIB_PATH as needed); test-examples.sh resolves Go/Rust/Python deps from that tree only — see README.md, scripts/setup-sdk.sh, and scripts/test-examples.sh.
  • Languages in this example: go, rust (paths under this directory; Python may live under a sibling python/ or shared reference per Language Implementations).
  • Models: Set cloud provider API keys and/or run Ollama locally when you execute the Run steps (interactive flags like --help / --verbose are documented below).

CLI tools, batch processing scripts

LLM

LanguagePathStatus
Rustrust/Available
Gogo/Available

Attach an installed SDK (NXUSKIT_SDK_DIR). See the repository README.md and scripts/test-examples.sh.

Terminal window
# From `/examples/patterns/blocking-api`:
cd rust && cargo build
cd go && make build
Terminal window
cd rust
cargo run
Terminal window
cd go
make build && bin/blocking-api