Skip to content

feat(acp): add Venice AI as a provider#105

Draft
gordonkoehn wants to merge 3 commits into
hummingbot:mainfrom
gordonkoehn:feat/venice-provider
Draft

feat(acp): add Venice AI as a provider#105
gordonkoehn wants to merge 3 commits into
hummingbot:mainfrom
gordonkoehn:feat/venice-provider

Conversation

@gordonkoehn

Copy link
Copy Markdown
Contributor

What

Adds Venice AI as a first-class provider in PydanticAIClient, mirroring the existing openrouter:* pattern. Venice exposes an OpenAI-compatible chat completions endpoint at https://api.venice.ai/api/v1.

After this, users can write agent keys like:

venice:llama-3.3-70b
venice:venice-uncensored

and Condor's agent features will route through Venice using VENICE_API_KEY from the environment.

Why

Venice is a privacy-focused inference provider (no logging, no training on prompts) that's particularly relevant for trading-context agents where prompt contents may include strategy / position data. Some users prefer it for that reason; this PR removes the need to write a custom wrapper.

Changes

  • Add "venice" to PYDANTIC_AI_PREFIXES
  • Add "venice": "https://api.venice.ai/api/v1" to DEFAULT_BASE_URLS
  • Add the venice branch in _build_model (requires VENICE_API_KEY env, modeled directly on the openrouter branch above it)
  • Document VENICE_API_KEY (and the previously-undocumented OPENROUTER_API_KEY and OPENAI_API_KEY) in .env.example

Test plan

  • With VENICE_API_KEY set, venice:<model> returns an OpenAIModel configured against Venice's base URL
  • Without VENICE_API_KEY, raises a clear RuntimeError with remediation hint
  • Without an explicit model id (venice:), raises a clear RuntimeError pointing to Venice's model docs
  • Other providers (openai:*, openrouter:*, ollama:*, etc.) unaffected — only adds a branch above the generic DEFAULT_BASE_URLS fall-through, same shape as openrouter

No tests added — the affected file doesn't have unit tests today; happy to add a small parametrize over providers if maintainers want it.

Venice (https://venice.ai) offers an OpenAI-compatible chat completions
endpoint at https://api.venice.ai/api/v1. This adds it as a first-class
provider so users can write `venice:<model-id>` in their agent_key,
mirroring the existing `openrouter:*` pattern.

Changes:
- Add "venice" to PYDANTIC_AI_PREFIXES
- Add Venice's base URL to DEFAULT_BASE_URLS
- Add the venice branch in _build_model (requires VENICE_API_KEY env)
- Document VENICE_API_KEY (and the other AI keys) in .env.example
Copilot AI review requested due to automatic review settings May 17, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Venice AI as a first-class provider option for PydanticAIClient by introducing a venice:<model> agent key prefix and routing it through Venice’s OpenAI-compatible API base URL using VENICE_API_KEY.

Changes:

  • Add venice to the recognized pydantic-ai model prefixes and default base URL mapping.
  • Add a dedicated _build_model branch for venice:* that enforces an explicit model id and requires VENICE_API_KEY.
  • Document OPENAI_API_KEY, OPENROUTER_API_KEY, and VENICE_API_KEY in .env.example.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
condor/acp/pydantic_ai_client.py Adds venice:* model resolution and default base URL wiring for Venice’s OpenAI-compatible endpoint.
.env.example Documents optional environment variables for common OpenAI-compatible provider API keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread condor/acp/pydantic_ai_client.py
Comment thread condor/acp/pydantic_ai_client.py
@david-hummingbot

Copy link
Copy Markdown
Contributor

Hi @gordonkoehn, is this PR complete or have you already tested if it works? Venice is not showing in the list of LLMs in the bot UI.

- Add "venice:" to the cloud-provider list in `_infer_tool_filter_mode()`
  so Venice models get tool_filter_mode=full (same as openai/openrouter/etc).
- Document the venice:model resolution path in the `_build_model()`
  docstring "Resolution:" section.

Refs Copilot comments on the two code locations.
Addresses @david-hummingbot's feedback: Venice now appears in the /agent
LLM picker. The shape mirrors the existing OpenRouter picker exactly:

- `"venice:"` sentinel in AGENT_OPTIONS opens a paginated picker.
- `handlers/agents/venice_models.py` fetches GET /v1/models with
  VENICE_API_KEY, filters to entries where
  `model_spec.capabilities.supportsFunctionCalling == true` AND
  `type == "text"`. Tool-calling is required by Condor's architecture
  so non-tool models are hidden. Cached 1h.
- `_venice_picker_keyboard` (menu.py) paginates 8/page with vc_page /
  vc_pick / vc_type / vc_type_confirm / vc_type_cancel / vc_noop
  callbacks — same prefix-shortening as OpenRouter to stay under
  Telegram's 64-byte callback_data cap.
- `_settings_keyboard` shows the currently-selected venice:<slug> with a
  bullet, parallel to the openrouter:<slug> case.
- Text-message handler routes typed slugs to `_resolve_venice_typed_slug`
  with the same UX as OpenRouter's manual-entry flow.

Smoke-tested on a live Condor: picker loads (75 Venice models filtered
down to ~N with tool support), selection sets agent_llm to "venice:<slug>",
the `_build_model()` path then routes prompts through Venice and returns
clean completions.

No new dependencies — reuses aiohttp already in the project.
@gordonkoehn

Copy link
Copy Markdown
Contributor Author

Updated with the UI picker — mirrored the OpenRouter pattern.
Screenshot 2026-05-19 at 20 30 03
Screenshot 2026-05-19 at 20 34 39

@gordonkoehn

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-05-19 at 20 41 55 seems to work

@david-hummingbot

Copy link
Copy Markdown
Contributor

Hi @gordonkoehn, I ran into some issues when testing Venice. I selected the llama-3.3-70b model and asked it to fetch my portfolio balance, it then started spamming this user context message along with the Pydantic error message as well.

image image

I couldn't stop it via the /agent command and CTRL + C in the terminal didn't stop it - had to kill the actual terminal window for it to stop.

Another issue is when using the gemma-4-uncensored model - again just asking for the portfolio balance returns this error.

image

I'm just picking random models but at this point it looks like the quality of the models that Venice provides might not be that great if it can't even fetch just the portfolio balance - it'll for sure fail when using the agent trading.

@gordonkoehn

gordonkoehn commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @david-hummingbot, thank you for testing this throughly – seems I opened this PR proposal prematurely, and didn't test throughly enough.

Perhaps, a dynamic shortlist of models in needed.

That indeed does not look satisfactory. Let me latently investigate. I will reset this PR to be a DRAFT; may resubmit if I get it all ironed out.

@gordonkoehn gordonkoehn marked this pull request as draft May 25, 2026 16:14
@david-hummingbot

Copy link
Copy Markdown
Contributor

@gordonkoehn No worries, let us know once the PR is ready for testing again.

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.

4 participants