Skip to content

Feat/venice provider v1#9

Draft
the-harry wants to merge 8 commits into
blob42:masterfrom
the-harry:feat/venice-provider-v1
Draft

Feat/venice provider v1#9
the-harry wants to merge 8 commits into
blob42:masterfrom
the-harry:feat/venice-provider-v1

Conversation

@the-harry

Copy link
Copy Markdown

No description provided.

The venice extra reuses the openai client since Venice is OpenAI-compatible (no point pulling the venice-ai SDK, it wants pydantic 2 which clashes with our langchain pin). onnxruntime is pinned to a wheel that actually loads on hardened kernels, and setuptools is capped below 81 because the TUI still imports pkg_resources.
New llm_provider switch (openai or venice), a venice_api_key read from VENICE_API_KEY and kept out of the saved file, and a VeniceSettings block for the model, base URL and web search. The missing-key warning only fires for the active provider now, and a broken chromadb import no longer takes the whole app down.
VeniceProvider wraps ChatOpenAI and points it at Venice's OpenAI-compatible endpoint. It folds enable_web_search into venice_parameters and drops null fields from the request body since Venice rejects them. build_llm() picks the backend from config.
langchain 0.0.266 still uses the old functions/function_call format, but Venice only accepts tools/tool_calls and 400s on the legacy keys. The provider now translates both ways: outgoing functions to tools, incoming tool_calls back to function_call, and it rewrites the message history so tool results go back as role tool with a tool_call_id. That's enough for OpenAIFunctionsAgent to drive Venice tools. Left a stub where x402 wallet auth would hook in.
make_llm() goes through build_llm() now so the configured provider is actually used by the bundled agents and the retrieval tool. They also stop blowing up when the Wikipedia tool isn't installed. Dropped a stray debug print.
Opening the manual with no docs/index.md threw an uncaught FileNotFoundError and killed the app. Catch it and show a fallback. instrukt/docs is generated, so it's fine for it to be missing in a dev checkout.
Add a commented config.example.yml covering both providers and how keys are handled, and a Venice section in the README with the model, web search and a note to use a local embedding for indexing.
Unit tests for the request params, web search, null stripping, the tool-call and message-history translation, and the factory, plus a live end-to-end tool-calling test that's skipped without a key. Also fixed two stale tests that were already failing on master.
@the-harry the-harry force-pushed the feat/venice-provider-v1 branch from 89a9490 to 1668018 Compare June 20, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant