Local LLM support for google.golang.org/adk via OpenAI-compatible endpoints.
| Package | Description |
|---|---|
gobot/petadk/lmstudio |
model.LLM implementation for LM Studio (and any OpenAI-compatible endpoint) |
MODEL_PROVIDER |
Description |
|---|---|
lmstudio |
Local LM Studio or any OpenAI-compatible endpoint |
geminiis removed from implementations/petadk_example. The switch ininternal/model/provider.gois kept to allow addingopenaior other providers in the future.
Open LM Studio, load a model (e.g. Meta-Llama-3.1-8B-Instruct), and start the local server:
- Default address:
http://localhost:1234 - Make sure "Enable CORS" is on in the server settings.
# implementations/petadk_example/cmd/app/.env
MODEL_PROVIDER=lmstudio
MODEL_NAME=lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF # must match the model loaded in LM Studio
MODEL_BASE_URL=http://localhost:1234/v1 # default, can omit
MODEL_API_KEY= # optional
MODEL_TIMEOUT=120s # optionalcd implementations/petadk_example/cmd/app
go run . webThen open http://localhost:8080 in your browser.
| Variable | Required | Default | Description |
|---|---|---|---|
MODEL_PROVIDER |
Yes | — | lmstudio (only supported value) |
MODEL_NAME |
Yes | — | Model identifier |
MODEL_BASE_URL |
No | http://localhost:1234/v1 |
Base URL for lmstudio |
MODEL_API_KEY |
No | — | API key (optional for local endpoints) |
MODEL_TIMEOUT |
No | без лимита | Request timeout, e.g. 120s |
LM Studio requires specific JSON schema formatting.
Two fixes are applied automatically in petadk/lmstudio/convert.go:
| Problem | Symptom | Fix |
|---|---|---|
genai.Schema.Type is UPPERCASE |
HTTP 400 invalid_union_discriminator |
genaiSchemaToJSONSchema() lowercases the type |
Empty struct → no "properties" |
HTTP 400 invalid_type received undefined |
normalizeRawSchema() adds "properties":{} |
go test ./petadk/...
go test ./implementations/petadk_example/...Tests use httptest.Server — no real LM Studio needed.
See implementations/petadk_example/README.md and implementations/petadk_example/AGENTS.md for the full modular architecture, pipeline description, and how to add new agents.