Skip to content

shumdude/petadk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

petadk

Local LLM support for google.golang.org/adk via OpenAI-compatible endpoints.

Packages

Package Description
gobot/petadk/lmstudio model.LLM implementation for LM Studio (and any OpenAI-compatible endpoint)

Supported providers (in implementations/petadk_example)

MODEL_PROVIDER Description
lmstudio Local LM Studio or any OpenAI-compatible endpoint

gemini is removed from implementations/petadk_example. The switch in internal/model/provider.go is kept to allow adding openai or other providers in the future.


Running with LM Studio

1. Start LM Studio

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.

2. Configure env

# 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                                                 # optional

3. Run the example

cd implementations/petadk_example/cmd/app
go run . web

Then open http://localhost:8080 in your browser.


Environment variables reference

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

lmstudio — schema compatibility

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":{}

Running tests

go test ./petadk/...
go test ./implementations/petadk_example/...

Tests use httptest.Server — no real LM Studio needed.


petadk_example architecture

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.

About

petadk - Go toolkit for integrating Google ADK with OpenAI-compatible LLM endpoints (LM Studio): model.LLM implementation, streaming/tool-call handling, schema normalization for compatibility, and reusable pipeline utilities for multi-agent apps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages