Skip to content

Add configurable LLM provider layer (Gemini, SiliconFlow, OpenAI-compatible)#8

Open
Albertchamberlain wants to merge 1 commit into
PromtEngineer:mainfrom
Albertchamberlain:feat/multi-llm-provider
Open

Add configurable LLM provider layer (Gemini, SiliconFlow, OpenAI-compatible)#8
Albertchamberlain wants to merge 1 commit into
PromtEngineer:mainfrom
Albertchamberlain:feat/multi-llm-provider

Conversation

@Albertchamberlain

@Albertchamberlain Albertchamberlain commented Jun 17, 2026

Copy link
Copy Markdown

Summary

This adds a small LLM provider layer so FsExplorer can run on Google Gemini (default) or OpenAI-compatible APIs such as SiliconFlow and OpenAI.

  • Backward compatible: no changes required for existing Gemini users (FS_EXPLORER_LLM_PROVIDER=google is the default).
  • Provider adapter: GoogleGeminiClient keeps native JSON schema output; OpenAICompatibleClient uses response_format=json_object with Action schema hints in the system prompt.
  • Flexible parsing: action_parser.py recovers common malformed JSON from weaker models (similar in spirit to the Ollama branch, but provider-agnostic).
  • Docs & tests: PROVIDERS.md, updated .env.example / README, unit tests for config + agent init, optional live test gated on SILICONFLOW_API_KEY.

Motivation

Several users (especially in regions where Gemini access is limited) want to run the agent on OpenAI-compatible hosted models. The existing feat/ollama-qwen3-native-api branch targets local Ollama specifically; this PR generalizes provider selection via environment variables without changing the exploration workflow.

Test plan

  • pytest tests/test_agent.py tests/test_llm_config.py tests/test_models.py (30 passed)
  • Manual smoke test with FS_EXPLORER_LLM_PROVIDER=google + GOOGLE_API_KEY
  • Optional: pytest tests/test_llm_integration.py with SILICONFLOW_API_KEY set

Notes

  • Vector indexing / embeddings still use Google Gemini embeddings by default; chat provider selection is independent (documented in PROVIDERS.md).
  • Adds openai as a runtime dependency for the compatible client.

Introduce a provider adapter so FsExplorer can use Google Gemini or OpenAI-compatible APIs (SiliconFlow, OpenAI) via FS_EXPLORER_LLM_PROVIDER and related env vars.

Google remains the default with native JSON schema output. OpenAI-compatible providers use response_format=json_object plus flexible action parsing for imperfect model output.

Includes PROVIDERS.md, updated tests, and optional live integration test gated on SILICONFLOW_API_KEY.
@Albertchamberlain Albertchamberlain force-pushed the feat/multi-llm-provider branch from 963b296 to 51f8f66 Compare June 18, 2026 06:37
@Albertchamberlain Albertchamberlain changed the title feat: add multi-provider LLM adapter (Google + SiliconFlow) Add configurable LLM provider layer (Gemini, SiliconFlow, OpenAI-compatible) Jun 18, 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.

1 participant