feat(zeph-llm): GonkaProvider chat/chat_stream/embed via signed transport (#3611)#3622
Merged
feat(zeph-llm): GonkaProvider chat/chat_stream/embed via signed transport (#3611)#3622
Conversation
…ransport (#3611) Implement GonkaProvider covering the non-tools subset of LlmProvider: chat, chat_stream, embed, and embed_batch over a secp256k1-signed request loop across an EndpointPool. - Add crates/zeph-llm/src/gonka/provider.rs with GonkaProvider: body constructed via OpenAI-compatible serialisation, signed per-request with fresh nanosecond timestamp, endpoint rotation with mark-failed cooldown on HTTP errors, streaming via openai_sse_to_stream - Add crates/zeph-llm/src/gonka/tests.rs with 10 wiremock integration tests covering chat, streaming, embed, embed_batch, retry, exhaustion, 400/context-length, timestamp freshness on retry - Extend EndpointPool with next_indexed() for correct per-slot mark-failed - Make now_ns() pub(crate) to avoid timestamp duplication in provider - Wrap key_bytes in Zeroizing<Vec<u8>> in RequestSigner::from_hex to zero intermediate heap allocation holding the raw private key - Add zeroize as optional dep under gonka feature in zeph-llm Closes #3611
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GonkaProviderimplementingLlmProvider::chat,chat_stream,embed,embed_batchover secp256k1-signed HTTPOpenAiProvider; each request is signed with a fresh nanosecond timestamp and routed throughEndpointPoolwith automatic mark-failed cooldown on errorsopenai_sse_to_streamafter the signed POSTEndpointPool::next_indexed()for correct per-slot mark-failed in retry loopskey_bytesinZeroizing<Vec<u8>>inRequestSigner::from_hexto zero intermediate heap allocationTool-calling (
chat_with_tools,chat_typed) deferred to #3612.Test plan
cargo nextest run -p zeph-llm --features "zeph-llm/gonka" --config-file .github/nextest.toml— all 33 gonka tests passcargo nextest run --workspace --features full --lib --bins --config-file .github/nextest.toml— 9269 tests passcargo clippy --workspace --features full -- -D warnings— cleancargo +nightly fmt --check— cleanCloses #3611
Part of epic #3602