Skip to content

feat: add api_base parameter for OpenAI-compatible endpoints - #130

Merged
mplatzer merged 2 commits into
mostly-ai:mainfrom
knQzx:feat/llm-api-base
Apr 30, 2026
Merged

mplatzer merged 2 commits into
mostly-ai:mainfrom
knQzx:feat/llm-api-base

Conversation

@knQzx

@knQzx knQzx commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

closes #86

adds an api_base argument that gets forwarded to litellm.acompletion. lets you point at openai-compatible endpoints (self-hosted vllm/ollama/lm studio, internal gateways, litellm proxy) without changing the model string.

```python
mock.sample(
tables=tables,
sample_size=10,
model="openai/gpt-4",
api_base="http://localhost:8000/v1",
)
```

mirrors how api_key is wired - new field on LLMConfig, threaded through _sample_common / sample / _asample / mock_data. None means "use litellm default", same semantic as api_key. test captures the kwargs handed to litellm.acompletion and asserts api_base is forwarded.

@mplatzer
mplatzer merged commit 0b7fd04 into mostly-ai:main Apr 30, 2026
2 checks passed
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.

[FEATURE]: bring your own LLM

2 participants