The authoritative symbol-level API documentation is on pkg.go.dev. The guides in this section explain the configuration and integration boundaries around those APIs.
| Guide | Description |
|---|---|
| Configuration Reference → | Credentials, model selection, generation options, runtimes, and YAML settings |
| LLM Providers → | llm-go-backed provider constructors, streaming, embeddings, and Codex subscription access |
| CLI Reference → | dspy-cli commands and flags |
pkg/core:
signatures, modules, LLM capability interfaces, execution state, and runtime
model resolutionpkg/modules:
Predict, ChainOfThought, ReAct, Refine, Parallel, and other DSPy modulespkg/optimizers:
GEPA, MIPRO, SIMBA, BootstrapFewShot, COPRO, and optimizer utilitiespkg/config:
typed file and environment configuration loadingpkg/llms:
adapters from llm-go generators to dspy-go’s compatibility interfaces, plus
dspy-go-owned embedding clientspkg/agents:
provider-neutral execution loops, harnesses, typed events, and tracespkg/agents/native:
provider-native tool-calling agents and sessionspkg/tools:
tool contracts, registries, composition, and built-in toolsetsProvider generation protocols and model metadata live in
llm-go. pkg/llms preserves the
core.LLM integration used by existing dspy-go modules and agents. dspy-go
continues to own Gemini and OpenAI-compatible embeddings because embedding is
part of that compatibility contract.
New consumers should depend on the smallest core capability interface they
need, such as core.TextGenerator, core.StreamGenerator, core.Embedder, or
core.ToolCallingChatLLM, rather than requiring the full core.LLM interface
unnecessarily.
llm, err := llms.NewLLM(apiKey, core.ModelGoogleGeminiFlash)
if err != nil {
return err
}
core.SetDefaultLLM(llm)predictor := modules.NewPredict(signature)
predictor.SetLLM(llm)ctx := core.WithRuntime(context.Background(), &core.Runtime{
DefaultLLM: llm,
})
result, err := predictor.Process(ctx, inputs)response, err := llm.Generate(ctx, prompt,
core.WithMaxTokens(1024),
core.WithTemperature(0.2),
)Use context.WithTimeout or context.WithCancel to control an operation’s
lifetime. Streaming calls return a core.StreamResponse; consume
ChunkChannel and call Cancel if you stop before the stream completes.
Use the exported core.ModelID constants instead of copying model strings when
possible. Model catalogs change more frequently than this documentation, so
consult the current pkg/core GoDoc and provider documentation for available
models and limits.
Capability support is model-specific. Check llm.Capabilities() at runtime
when your application requires streaming, JSON, tool calling, vision, audio,
or embeddings.