Menu ▾ ▴

#25 orko-providers: OpenAI-compatible engine with OpenAI and DeepSeek presets

closed
nobody
None
2026-11-21
2026-11-21
Anonymous
No

Originally created by: SAMAD101

Adds the OpenAI-compatible provider engine to orko-providers, with OpenAI and DeepSeek presets.

Closes [#3], closes [#5].

What's in it

  • codec: builds the Chat Completions request JSON (text, multipart content, tools) and parses the SSE stream into CompletionChunks, including tool-call deltas, usage, refusals and reasoning (reasoning_content / reasoning). It does no IO.
  • Transport: a small object-safe trait for the HTTP call, so users can bring their own client.
  • HyperTransport (default transport-hyper feature): hyper 1.x over async-net and rustls with native roots. It works under any executor (Tokio, smol, block_on), spawns no tasks and has a 60 s request timeout (with_timeout). It connects to all resolved addresses at once, so a dead IPv6 route doesn't hang requests.
  • OpenAiCompatible with Quirks, plus openai() / deepseek() presets in src/providers/ and from_str("provider:model").
  • Facade: orko::providers is wired up and documented. The examples hello_openai and hello_deepseek live at the repo root and fall back to an offline stub when no key is set.
  • README updates for the root and the crate.

No tokio dependency is added outside orko-runtime. hyper 1.x still pulls in tokio with only the sync feature, so it shows up in Cargo.lock.

Known limits

  • One connection per request, no pooling.
  • The timeout doesn't cover a stream that stalls midway.
  • Tool results are sent as user messages until orko-core carries tool_call_id.
  • Files must be inline base64.

Testing

  • cargo test --workspace: 14 provider tests, including a real HTTP round trip under block_on and a timeout test.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo fmt --check and rustdoc with -D warnings are clean, and --no-default-features builds pass.
  • Live calls to OpenAI and DeepSeek with invalid keys return the expected 401.

🤖 Generated with Claude Code

Related

Tickets: #26
Tickets: #3
Tickets: #5

Discussion

  • Anonymous

    Anonymous - 2026-11-21

    Originally posted by: SAMAD101

    Superseded by a new PR from add-openai-compatible-providers, which adds the rest of the OpenAI-compatible presets.

     
  • Anonymous

    Anonymous - 2026-11-21

    Ticket changed by: SAMAD101

    • status: open --> closed
     

Log in to post a comment.