Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@
# Gemini: LLM_API_KEY=AIza...
# DeepSeek: LLM_API_KEY=sk-...
LLM_API_KEY=your-key-here

# Optional: API base URL override for self-hosted / proxied providers.
# `openkb init` writes the right one for the chosen model automatically.
# You can also set these by hand — LiteLLM reads them per provider:
# OPENAI_API_BASE=http://localhost:11434/v1 # Ollama, vLLM, LM Studio, ...
# ANTHROPIC_API_BASE=https://your-proxy.example.com
# OPENROUTER_API_BASE=https://openrouter.ai/api/v1
# Omit for the official endpoint of each provider.
12 changes: 10 additions & 2 deletions openkb/agent/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ async def compile_short_doc(
source_path: Path,
kb_dir: Path,
model: str,
max_concurrency: int = DEFAULT_COMPILE_CONCURRENCY,
max_concurrency: int | None = None,
) -> None:
"""Compile a short document using a multi-step LLM pipeline with caching.

Expand All @@ -1956,6 +1956,10 @@ async def compile_short_doc(
language: str = config.get("language", "en")
entity_types = resolve_entity_types(config)

# Resolve concurrency: explicit param > config > hard-coded default.
if max_concurrency is None:
max_concurrency = config.get("compile_concurrency", DEFAULT_COMPILE_CONCURRENCY)

wiki_dir = kb_dir / "wiki"
schema_md = get_agents_md(wiki_dir)
content = source_path.read_text(encoding="utf-8")
Expand Down Expand Up @@ -2005,7 +2009,7 @@ async def compile_long_doc(
kb_dir: Path,
model: str,
doc_description: str = "",
max_concurrency: int = DEFAULT_COMPILE_CONCURRENCY,
max_concurrency: int | None = None,
) -> None:
"""Compile a long (PageIndex) document's concepts and index.

Expand All @@ -2019,6 +2023,10 @@ async def compile_long_doc(
language: str = config.get("language", "en")
entity_types = resolve_entity_types(config)

# Resolve concurrency: explicit param > config > hard-coded default.
if max_concurrency is None:
max_concurrency = config.get("compile_concurrency", DEFAULT_COMPILE_CONCURRENCY)

wiki_dir = kb_dir / "wiki"
schema_md = get_agents_md(wiki_dir)
summary_content = summary_path.read_text(encoding="utf-8")
Expand Down
Loading