Repository navigation
Conversation
…nd solar-embedding-2 Upstage retires solar-pro3, solar-pro2 and solar-mini on 2026-10-30 (KST). Register solar-pro4 and solar-mini4 (512K context, function calling), add the missing solar-pro3 context window (it fell back to 32K), accept all seven reasoning_effort values, warn instead of raising KeyError when a model has no registered tokenizer, and add solar-embedding-2 (1024 dimensions) to the embedding model table. Signed-off-by: YoungjuKim <[email protected]>
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.
Description
Upstage released new models, and several existing ones are being retired. This PR registers the new models in the Upstage LLM and embedding integrations:
solar-pro3,solar-pro2,solar-miniandsyn-250326on 2026-10-30 (KST). Their replacements aresolar-pro4andsolar-mini4.embedding-query/embedding-passagealiases, which currently point tosolar-embedding-1-large-*, will be retired on 2026-12-31 (UTC).solar-embedding-2-*is the current embedding model.llama-index-llms-upstage(0.9.0 -> 0.9.1)solar-pro4andsolar-mini4toCHAT_MODELS(context window512000) andFUNCTION_CALLING_MODELS, andsolar-pro4toDOC_PARSING_MODELS. Without that entry, moving fromsolar-pro3tosolar-pro4would makefile_path=raiseValueError, and after 2026-10-30 no model on the list would remain.solar-mini4is left out ofDOC_PARSING_MODELS, since nosolar-mini*model has been on that list before.solar-pro3missing fromCHAT_MODELS. Because of this,metadata.context_windowfell back to the 32768 default. It now uses the documented 128000.upstage/solar-pro4-tokenizertoSOLAR_TOKENIZERS.solar-mini4is not added, because Upstage has not published a tokenizer for it.KeyErrorinUpstage._tokenizer. Any model that is not inSOLAR_TOKENIZERS(for examplesolar-mini4) used to hitKeyErrorwhile building the warning message. Now it warns and approximates with the configuredtokenizer_name, which is the tokenizer the method already loads.reasoning_effortfromlow | medium | highto the values the API accepts:none | minimal | low | medium | high | xhigh | max.llama-index-embeddings-upstage(0.7.0 -> 0.7.1)solar-embedding-2toUPSTAGE_EMBEDDING_MODELS. It maps tosolar-embedding-2-query/solar-embedding-2-passage, and the existing-query/-passagesuffix stripping works for it too.embedding.solar-embedding-2returns 1024-dim vectors, whileembedding/solar-embedding-1-largereturn 4096-dim vectors. Changing the default in a patch release would quietly break existing vector indexes, so new users should passmodel="solar-embedding-2"explicitly. Switching the default before the alias is retired can be done in a separate PR if you prefer.The context-window values follow Upstage's docs. The docs write
solar-pro3as both "128K" and "128,000", so "512K" forsolar-pro4/solar-mini4is recorded as512000rather than524288.Responses with reasoning already work.
Upstageextendsllama_index.llms.openai.OpenAI, andllama-index-llms-openai>= 0.7.9 (0.7.10 in this package'suv.lock) turns thereasoningfield into aThinkingBlock, for both normal and streamed responses. This PR does not change that.Official docs:
API behavior I checked by hand on 2026-10-16 17:33 UTC against
https://api.upstage.ai/v1. I did this outside the test suite, and the tests in this PR are fully mocked:GET /modelssolar-pro4,solar-mini4,solar-pro3listedPOST /chat/completions(plain)solar-pro4,solar-mini4POST /chat/completions(streaming with usage,tools,json_schemastrict)solar-pro4finish_reason=tool_callsPOST /chat/completions,reasoning_effort=none,minimal,low,medium,high,xhigh,maxsolar-pro4none/minimalreturn no reasoning.lowand above returnmessage.reasoningandusage.completion_tokens_details.reasoning_tokensPOST /chat/completions,reasoning_effort=lowsolar-mini4POST /chat/completions,reasoning_effort="foo"solar-pro4POST /embeddings(2-item batch)solar-embedding-2-query,solar-embedding-2-passagePOST /embeddingsembedding-query,solar-embedding-1-large-queryhttps://api.upstage.ai/v1/solar(the integrations' default)/v1Disclosure: I work at Upstage.
AI assistance: I drafted this change with an AI coding assistant (Claude), covering the model-table updates, the
_tokenizerfallback and the new unit tests. The model values were checked against Upstage's docs and the API calls in the table above, also with Claude's help. The checks I ran locally are listed below.New Package?
Did I fill in the
tool.llamahubsection in thepyproject.tomland provide a detailed README.md for my new integration or package?Version Bump?
Did I bump the version in the
pyproject.tomlfile of the package I am updating? (Except for thellama-index-corepackage)Type of Change
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.
New tests (no network, fully mocked):
llms-upstage/tests/test_upstage.pytest_model_metadata: context window and function-calling flag forsolar-mini,solar-pro2,solar-pro3,solar-pro4,solar-mini4.test_tokenizer_without_registered_tokenizer: noKeyErrorforsolar-mini4, it warns and loadstokenizer_name.test_tokenizer_mismatch_warning: the mismatch warning namesupstage/solar-pro4-tokenizer.test_parameter_integration: now covers all 7reasoning_effortvalues.embeddings-upstage/tests/unit_tests/test_embeddings_upstage.pytest_upstage_embedding_2_model_name: engine names, including suffix stripping.test_upstage_embedding_2_request_model: query and passage requests are sent with the right model names, using a mocked client.Run locally (Python 3.12, Linux x86_64, uv, in a throwaway container):
cd llama-index-integrations/llms/llama-index-llms-upstage && uv run -- pytest: 37 passedcd llama-index-integrations/embeddings/llama-index-embeddings-upstage && uv run -- pytest: 14 passedpython -m py_compileon every changed.pyfile,tomllibon bothpyproject.tomlfilesuv run make lint(black / ruff / codespell / mypy): not run, left to CISuggested Checklist:
uv run make format; uv run make lintto appease the lint gods🤖 Generated with Claude Code