SDK FAQs — Unique AI Documentation

SDK FAQs

2 min read

About these FAQs

SDK vs. Toolkit

What’s the difference between the SDK and the Toolkit?

When to use which: Start with Toolkit for faster dev and safer defaults. Drop down to the SDK when you need advanced control.

Why am I seeing timeouts when running multiple large requests in parallel?

Large inputs (e.g., 50K–100K tokens) combined with parallelism increase the chance that one or more calls hit a gateway timeout or provider throttle. Even if most calls succeed, a single slow outlier can delay your overall workflow.

Mitigations:

Is a timeout the same as a rate‑limit error?

No. Timeouts are typically network/gateway/deadline related. Rate‑limit errors are explicit responses from a model provider. However, logs may sometimes show ambiguous “upstream timeout” messages when rate‑limits are involved. Inspect error codes and headers; if in doubt, log both the HTTP status and provider error type.

Concurrency & rate limiting

What’s the recommended pattern for parallel LLM calls?

Should I send requests to multiple model providers simultaneously?

It’s possible, but do so intentionally. Differences in output style/cost/latency may affect UX and post‑processing. If you diversify for resiliency, normalize responses (schemas) and track provider‑level SLAs.

Function calling & tools

Does the SDK support function calling (tool use)?

Yes. You can declare tools/functions and let the model select and call them. The SDK exposes helpers for registering tool schemas and handling tool invocations.

Best practices:

LINK: https://github.com/Unique-AG/ai/blob/main/tutorials/unique_basics/sdk_examples/chat_complete.py

Short‑term memory

Is there a short‑term memory feature?

Yes. Sessions/chats can retain recent context (short‑term memory) persisted in your project datastore. Limits are configurable per deployment. Memory is scoped to a chat/session ID and is not a substitute for long‑term knowledge bases.

Tips:

Common Errors