Skip to content

fix: route embedding requests with a supported encoding format - #97

Draft
z125316840-code wants to merge 2 commits into
frappe:developfrom
z125316840-code:agent/fix-embedding-model-connection-test
Draft

fix: route embedding requests with a supported encoding format#97
z125316840-code wants to merge 2 commits into
frappe:developfrom
z125316840-code:agent/fix-embedding-model-connection-test

Conversation

@z125316840-code

@z125316840-code z125316840-code commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • detect embedding models using LiteLLM metadata, with a model-name fallback for custom providers
  • test embedding models with litellm.embedding() and explicit encoding_format="float"
  • send the same explicit float encoding format for real knowledge-base dimension probes and batch embeddings
  • keep chat models on litellm.completion()
  • add regression coverage for connection tests and knowledge embedding calls

Root cause

FlowModel.test_connection() originally sent embedding-only models to the chat-completions endpoint. After fixing that route, real knowledge-base embedding calls still omitted encoding_format. With LiteLLM 1.83.7, the OpenAI-compatible provider received an empty value and rejected it because it only supports float or base64.

Verification

  • git diff --check
  • Python 3.14 bytecode compilation in the deployment image
  • 25 Flow Model integration tests passed in the original fix
  • 131 Flow knowledge integration tests passed with the follow-up fix
  • live openai/text-embedding-v4 knowledge dimension probe returned 1024
  • live deployment returned HTTP 200 with no recent severe service logs

Closes #96

@z125316840-code z125316840-code changed the title fix: test embedding models through embeddings endpoint fix: route embedding requests with a supported encoding format Aug 18, 2026
vampiiluk added a commit to vampiiluk/flow_client that referenced this pull request Aug 19, 2026
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.

test_connection on Flow Model always fails for embedding models (chat ping via litellm.completion)

1 participant