feat(llm): per-node local/edge VLM endpoints + JSONC URL fix + provider-surface tests - #132
Open
RanjithRagavan wants to merge 6 commits into
Open
RanjithRagavan wants to merge 6 commits into
RanjithRagavan wants to merge 6 commits into
Conversation
Add api_base, api_key, max_tokens, timeout_seconds and is_multimodal to the LLM config schema (artemis/config/llm.py) and forward them in _resolve_endpoint() (artemis/services/llm.py) for primary and fallback nodes, so local OpenAI-compatible endpoints (Ollama/vLLM/custom) can be configured per agent. LLM.validate_provider no longer requires cloud API keys for ollama/vllm/custom providers. Refs #1, refs #2
The local-ollama preset used provider 'openai' with no api_base, which failed credential validation without OPENAI_API_KEY. Switch it to provider 'ollama' with api_base http://localhost:11434/v1 and a local VLM default (qwen2.5vl:7b), in both config/artemis.jsonc and the bundled artemis/resources/config/artemis.jsonc. That requires strip_json_comments (artemis/utils/file.py) to ignore '//' and '/* */' inside string literals; the previous regex truncated URL values such as 'http://localhost:11434/v1' and broke config loading. Also document local-endpoint env fallbacks in .env.example. Refs #2
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Cover ModelProvider.from_string alias parsing (incl. ollama/vllm/custom), ModelFactory.create_model construction for local endpoints with langchain_openai.ChatOpenAI mocked (no network), _resolve_endpoint passthrough of api_base/api_key/max_tokens/timeout_seconds/is_multimodal for primary and fallback nodes, local-provider credential validation, string-safe JSONC comment stripping, and the local-ollama presets. Refs #6
Add docs/design/on-device-vlm.md covering deployment shapes (host-side Ollama/llama.cpp/vLLM, LAN edge box, future on-SoC), the new endpoint config schema with a hybrid local-flash + cloud-pro JSONC example, perception pipeline next steps (#3/#4/#5), the privacy model, and a latency measurement plan. Link it from the roadmap bullets in README.md and README_CN.md. Refs #7
Pre-existing on main: 11 lint errors (datetime.UTC alias style) fail the Lint Python step under the ruff version CI resolves today. Applied ruff check --fix + format so the pipeline goes green again.
RanjithRagavan
force-pushed
the
upstream-on-device-endpoint-config
branch
from
September 19, 2026 02:06
f72781b to
1c9be8b
Compare
Author
|
@google-cla I signed it! |
1 similar comment
Author
|
@google-cla I signed it! |
RanjithRagavan
force-pushed
the
upstream-on-device-endpoint-config
branch
from
September 19, 2026 17:08
1c9be8b to
e052219
Compare
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.
Summary
Unblocks the On-Device Lightweight VLMs roadmap item by making local/edge OpenAI-compatible endpoints (Ollama, llama.cpp-server, vLLM, LM Studio) configurable per agent node — today only the global
OPENAI_BASE_URLenv var works, forcing every node onto one endpoint.Closes #131
Relation to #128: complementary, not overlapping. #128 adds admin-UI/env credential plumbing (
CUSTOM_LLM_API_KEY,Settings.get_api_key) andvalidate_providerbranches. This PR adds the per-node config→endpoint passthrough in_resolve_endpoint(), repairs thelocal-ollamapreset, fixes a latent JSONC parser bug, and adds provider-surface tests. Happy to rebase whichever lands second.Changes
Endpoint plumbing
artemis/config/llm.py:LLMgains optionalapi_base,api_key,max_tokens,timeout_seconds,is_multimodal(types matchModelEndpoint);validate_provider()no longer requires cloud keys forollama/vllm/customartemis/services/llm.py:_resolve_endpoint()forwards all five fields intoModelEndpoint, for primary and fallback nodesPreset + parser fixes
local-ollamapreset (both config copies):provider: "ollama",model: "qwen2.5vl:7b",api_base: "http://localhost:11434/v1"— boots with zero cloud keysartemis/utils/file.py:strip_json_comments()rewritten as a string-aware scanner — the old regex stripped//inside quoted strings, corrupting any config containing a URL value (blocking bug for any config-level endpoint fix).env.exampledocuments local-endpoint variablesTests
tests/unit/test_llm_router.py: 22 tests — provider alias parsing, mockedChatOpenAIconstruction for OLLAMA/VLLM/CUSTOM,_resolve_endpointpassthrough/defaults/fallback, local-provider validation, JSONC string safety, preset regressionDocs
docs/design/on-device-vlm.md: design doc for the on-device VLM roadmap item (deployment shapes, endpoint schema with hybrid local-flash + cloud-pro example, perception-pipeline next steps, privacy model, latency measurement plan); roadmap bullets in both READMEs link to itDrive-by CI fix
playground/backend_manager: auto-fixed 11 pre-existing ruff 0.16.3 lint errors (datetime.UTC alias style) that fail theLint Pythonstep under the ruff version CI resolves today — verified failing on a clean checkout ofmainTest plan
pytest tests/unit/test_llm_router.py tests/unit/test_llm_reliability.py tests/unit/test_llm_structured.py tests/unit/test_llm_gateway.py— 44 passedpytest tests/unit— failure set identical before/after this branch (pre-existing, environment-related e.g. missingGOOGLE_API_KEY)ruff check+ruff format --checkclean on the whole treeLLM(provider="ollama", model="qwen2.5vl:7b", api_base="http://localhost:11434/v1")validates with no cloud keys setExample: hybrid on-device setup now possible