Sign inSign up

genaiwithms/uai-sdk

By genaiwithms

•Updated about 2 months ago

Unified Python SDK for 8 Chinese LLM providers.

Image
Machine learning & AI
Developer tools
0

102

genaiwithms/uai-sdk repository overview

⁠Universal AI Provider SDK

The official uai-sdk container image ships the uai CLI for the Universal AI Provider SDK for Python⁠: one consistent interface across eight Chinese LLM providers — DeepSeek, Qwen, GLM, Kimi, MiniMax, StepFun, Doubao, and Hunyuan — with an opt-in middleware pipeline, strict capability enforcement, and zero vendor lock-in.

⁠What the image does

Gives you the full SDK in a slim, non-root container. The uai CLI is the entrypoint, so every command runs exactly as it would from a local install:

  • uai list-providers — registered providers and whether a key is configured
  • uai list-models <provider> — models, context windows, and capabilities
  • uai benchmark — benchmark chat models across providers with live TTFT, latency, token throughput, and cost

⁠Features

  • 8 providers, 1 interface — chat, streaming, tools, vision, embeddings, and rerank through a single API
  • Fail fast, not late — the capability matrix rejects unsupported features before any network call
  • Opt-in middleware — retry, cache, circuit breaker, logging, metrics, tracing
  • Typed end to end — Pydantic v2 models throughout
  • Lean and safe — ~150 MB, runs as a non-root user, no volume mounts required (the CLI only writes to stdout)
  • Works with Docker and Podman

⁠Pull

# Docker
docker pull genaiwithms/uai-sdk:latest

# Podman
podman pull docker.io/genaiwithms/uai-sdk:latest

Versions are tagged on Docker Hub (0.2.0, latest).

⁠Usage

docker run --rm genaiwithms/uai-sdk:latest list-providers
docker run --rm genaiwithms/uai-sdk:latest list-models deepseek

Pass an API key with -e to run real requests:

docker run --rm \
    -e DEEPSEEK_API_KEY="sk-..." \
    genaiwithms/uai-sdk:latest benchmark --provider deepseek

⁠Configuration

Configuration layers, highest precedence first: environment variables → YAML/JSON config file → built-in registry defaults.

Mount a config file and point the SDK at it:

docker run --rm \
    -v "$PWD/uai.yaml:/home/uai/uai.yaml:ro" \
    -e UAI_CONFIG_PATH=/home/uai/uai.yaml \
    genaiwithms/uai-sdk:latest list-providers

⁠Environment variables

VariablePurpose
DEEPSEEK_API_KEY, DASHSCOPE_API_KEY, BIGMODEL_API_KEY, MINIMAX_API_KEY, MOONSHOT_API_KEY, STEPFUN_API_KEY, ARK_API_KEY, HUNYUAN_API_KEYProvider API keys
UAI_PROVIDER_{NAME}_BASE_URLPoint a provider at a proxy, gateway, or mock server
UAI_PROVIDER_{NAME}_TIMEOUTRequest timeout in seconds
UAI_PROVIDER_{NAME}_MAX_RETRIESRetry ceiling
UAI_PROVIDER_{NAME}_RATE_LIMIT_RPM / _TPMRequests-per-minute / tokens-per-minute limits
UAI_PROVIDER_{NAME}_DISABLE_{CAPABILITY}Force-disable a capability (e.g. a broken vision endpoint)
UAI_CONFIG_PATHPath to a YAML/JSON config file

Example:

docker run --rm \
    -e DASHSCOPE_API_KEY="sk-..." \
    -e UAI_PROVIDER_QWEN_TIMEOUT="60" \
    genaiwithms/uai-sdk:latest benchmark --providers qwen

⁠Setup

The SDK reads provider credentials from the process environment — there is no setup step beyond exporting your key, and .env files are not read by the SDK itself.

Full documentation — quick start, provider matrix, middleware, structured output, tool calling, and the Provider Development Kit — lives in the GitHub README⁠.

Tag summary

Content type

Image

Digest

sha256:57be20d1f…

Size

50.3 MB

Last updated

about 2 months ago

docker pull genaiwithms/uai-sdk