Skip to content

Latest commit

 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OmniLLM Provider for Anthropic

Go CI Go Lint Go SAST Docs Visualization License

Thick provider for OmniLLM using the official anthropic-sdk-go SDK.

Installation

go get github.com/plexusone/omnillm-anthropic

Quick Start

import (
    omnillm "github.com/plexusone/omnillm-core"
    _ "github.com/plexusone/omnillm-anthropic" // Auto-registers thick provider
)

client, _ := omnillm.NewClient(omnillm.ClientConfig{
    Provider: omnillm.ProviderNameAnthropic,
    APIKey:   os.Getenv("ANTHROPIC_API_KEY"),
})

Feature Support

Feature Supported
Chat Completion Yes
Streaming Yes
Tool Calling Yes
System Messages Yes
Extended Thinking Yes
JSON Mode No

Extended Thinking

Anthropic Claude models support extended thinking for complex reasoning tasks:

import omnillm "github.com/plexusone/omnillm-core"

// Using Anthropic-style Thinking config (native)
budget := int64(8192)
response, err := client.CreateChatCompletion(ctx, &omnillm.ChatCompletionRequest{
    Model: "claude-sonnet-4-20250514",
    Thinking: &omnillm.ThinkingConfig{
        Type:         omnillm.ThinkingTypeEnabled,
        BudgetTokens: &budget,
    },
    Messages: messages,
})

// Or use ReasoningEffort for cross-provider compatibility
effort := omnillm.ReasoningEffortHigh
response, err := client.CreateChatCompletion(ctx, &omnillm.ChatCompletionRequest{
    Model:           "claude-sonnet-4-20250514",
    ReasoningEffort: &effort,
    Messages:        messages,
})

ThinkingType Values

Value Description
omnillm.ThinkingTypeEnabled Enable thinking with explicit budget
omnillm.ThinkingTypeDisabled Disable thinking
omnillm.ThinkingTypeAdaptive Let the model decide

ReasoningEffort Mapping

ReasoningEffort Anthropic Behavior
"none" Thinking disabled
"low", "medium" Adaptive thinking
"high" Enabled with budget from MaxTokens

See Reasoning Feature Guide for details.

Configuration

Field Required Description
APIKey Yes Anthropic API key
BaseURL No Custom endpoint

Documentation

See OmniLLM Core for full API documentation.

License

MIT

About

Thick provider for OmniLLM using the official anthropic-sdk-go SDK.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages