add local Ollama FastContext config#28
Open
marcusschiesser wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates FastContext’s local/CLI configuration to prefer FC_* environment variables, allows running against local OpenAI-compatible endpoints (e.g., Ollama) without supplying a real API key, and documents a macOS Ollama quick start for a quantized FastContext model.
Changes:
- Switched agent factory configuration to
FC_MODEL,FC_BASE_URL, with optionalFC_API_KEY(while still supporting legacyMODEL/BASE_URL/API_KEY). - Updated the LLM client initialization to tolerate a missing API key and expanded reasoning-field parsing for responses.
- Added README documentation for local Ollama setup and updated environment variable names in docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/fastcontext/agent/llm.py |
Allows missing API key via placeholder, adds FC_REASONING_EFFORT, and broadens reasoning extraction from responses. |
src/fastcontext/agent/agent_factory.py |
Introduces FC_* env var helpers with legacy fallback and requires model/base URL to be set. |
README.md |
Documents FC_* configuration and adds an Ollama quick start section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+77
to
81
| reasoning_effort = os.getenv("FC_REASONING_EFFORT") | ||
| if reasoning_effort: | ||
| payload["reasoning_effort"] = reasoning_effort | ||
| if "qwen" in self.model: | ||
| payload["extra_body"] = { |
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
FC_MODEL,FC_BASE_URL, and optionalFC_API_KEYfor CLI model configuration.Validation
uv run python -m py_compile src/fastcontext/agent/agent_factory.py src/fastcontext/agent/llm.pyFC_BASE_URL,FC_MODEL, and no API key.Notes
uv run pytestcurrently reports existing async test collection failures for async test functions without async markers/configuration; unrelated synchronous tests passed.