Commit Graph

6 Commits

Author SHA1 Message Date
jay77721
2e2d12d262 feat: add batch_size to all embedding model configs (#17877)
## Summary

Add a `batch_size` field to every embedding model entry in
`conf/models/*.json`. The field represents the maximum number of text
inputs that can be submitted to the embedding API in a single request.

**75 embedding models across 30 config files** now carry a `batch_size`.
Values were verified against each provider's official documentation (see
the verification table at `Desktop/embedding_models_verified.md`).

## Distribution

| batch_size | # models | Provider / Model |
|---|---|---|
| 1 | 2 | AWS Bedrock `amazon.titan-embed-text-v1/v2:0` — Bedrock
`invoke` accepts a single input per call |
| 10 | 3 | Aliyun `text-embedding-v3/v4`, Volcengine
`doubao-embedding-vision-251215` |
| 16 | 5 | BaiChuan `Baichuan-Text-Embedding`, Baidu Qianfan
`embedding-v1`, Mistral `mistral-embed`, Replicate (x2) |
| 32 | 10 | NVIDIA NIM (x3), SILICONFLOW (x2), PPIO (x3), GiteeAI
`bge-m3`, HuaweiCloud `bge-m3` |
| 50 | 4 | Tencent Hunyuan `kinfra` embeddings (x4) — `InputList.N` max
50 |
| 96 | 8 | Cohere embed-v3/v4 (x5), Bedrock Cohere (x3) |
| 100 | 3 | Google Gemini `text-embedding-004`, Upstage (x2) |
| 512 | 5 | Zhipu GLM `embedding-2/3` (x2), Perplexity `pplx-embed`
(x2), Astraflow `text-embedding-3-large` |
| 1000 | 9 | Voyage AI (x9) — API reference max |
| 1024 | 1 | DeepInfra `Qwen/Qwen3-Embedding-4B` |
| 2048 | 15 | OpenAI (x3) + OpenAI-API-compatible proxies (CometAPI,
n1n, Jiekou.AI, GreenPT, TogetherAI, NovitaAI) — OpenAI contract limit |
| 16384 | 10 | Jina (x8), 302.AI, GiteeAI `jina-clip-v2` — no documented
Jina batch limit, safe high cap |

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-06 10:47:38 +08:00
jay77721
47ecc2a231 feat: populate content_length and max_output from official docs (#17836)
## Summary

- Verify and populate `content_length` (context window) and `max_output`
(max generation tokens) for all **478 chat/vision models** across **47
provider configs**
- Data sourced from **official API documentation** via 12 parallel
agents + targeted web verification
- Update Go test assertions to match verified values

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 15:22:57 +08:00
Jin Hai
c1f960cd47 Go: introduce content_length and max_output (#17807)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-08-04 19:08:31 +08:00
Haruko386
e0ad4f8339 Go: implement embed, rerank for PPIO provider (#17486)
### Summary

As title #17284

#### verified from CLI
```
RAGFlow(api/default)> embed text 'walkerwhat' 'jumperwho' with 'qwen/qwen3-embedding-0.6b@test@ppio' dimension 16
+-----------+-------+
| dimension | index |
+-----------+-------+
| 1024      | 0     |
| 1024      | 1     |
+-----------+-------+

RAGFlow(api/default)> rerank query 'what is rag' document 'rag is retrieval augment generation' 'rag need llm' 'famous rag project includes ragflow' with 'baai/bge-reranker-v2-m3@test@ppio' top 3
+-------+-----------------+
| index | relevance_score |
+-------+-----------------+
| 0     | 0.9830034       |
| 2     | 0.06399203      |
| 1     | 0.04665664      |
+-------+-----------------+
```
2026-07-28 19:16:31 +08:00
Haruko386
c575164695 Go: add tools for a lot of providers (#17341)
### Summary

As title

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-24 19:33:38 +08:00
ghost
b2053cc3c7 feat(go-models): add PPIO provider driver (#15099)
### What problem does this PR solve?

Closes #15089.

Adds PPIO support to the Go model-provider layer so PPIO instances can
be routed through the Go API server with the same OpenAI-compatible
chat, streaming, model listing, and connection-check flow used by other
SaaS providers.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

## Summary

- Added a PPIO Go model driver.
- Added the PPIO provider catalog and default OpenAI-compatible API URL.
- Registered PPIO in the model factory.
- Added focused provider and provider-manager tests.

## What changed

- Implemented chat completions, SSE streaming, ListModels, and
CheckConnection for PPIO.
- Covered request shape, stream termination, reasoning fallback, model
listing, custom base URLs, safe transport setup, unsupported methods,
and provider config loading.
- Kept the provider catalog aligned with the existing RAGFlow PPIO
factory model set.
- Cleaned up pre-existing Go model package validation blockers so the
scoped provider tests can run normally with vet enabled.

## Why

The existing Python/provider catalog path includes PPIO, but the Go
model-provider layer did not have a PPIO driver, so the Go API server
could not instantiate or use PPIO as requested in #15089.
2026-05-22 11:52:18 +08:00