Skip to content

Commit d89481a

Browse files
committed
fix HowTo config
1 parent 503dc42 commit d89481a

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

doc/HOWTO.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- [HowTos](#howtos)
44
- [Setup environment](#setup-environment)
5+
- [Example configurations](#example-configurations)
56

67

78
## Setup environment
@@ -16,36 +17,58 @@ Once the provider and LLMs access is configures, your application can start usin
1617
```go
1718
import "github.com/kshard/chatter/provider/autoconfig"
1819

19-
llm, err := autoconfig.New("thinker")
20+
llm, err := autoconfig.FromNetRC("thinker")
2021
if err != nil {
2122
panic(err)
2223
}
2324
```
2425

25-
The `autoconfig` reads the desired configuration from `~/.netrc` and creates appropriate instance of LLM API.
26+
The `autoconfig` reads the desired configuration from `~/.netrc` and creates appropriate instance of LLM API. Your `~/.netrc` file must include at least the `provider` and `model` fields under a named service entry. For example:
27+
28+
```
29+
machine thinker
30+
provider provider:bedrock/foundation/converse
31+
model us.anthropic.claude-3-7-sonnet-20250219-v1:0
32+
```
33+
34+
* `provider` specifies the full path to the provider's capability (e.g., `provider:bedrock/foundation/converse`). The path ressembles import path of providers implemented by this library
35+
* `model` specifies the exact model name as recognized by the provider
36+
37+
Each provider and model family may support additional options. These can also be added under the same `machine` entry and will be passed into the corresponding provider implementation.
38+
39+
```
40+
region // used by Bedrock providers
41+
host // used by OpenAI providers
42+
secret // used by OpenAI providers
43+
timeout // used by OpenAI providers
44+
dimensions // used by embedding families
45+
```
46+
47+
### Example configurations
48+
2649

2750
**For AWS Bedrock**, `~/.netrc` config is
2851
```
2952
machine thinker
30-
provider bedrock
53+
provider provider:bedrock/foundation/converse
54+
model us.anthropic.claude-3-7-sonnet-20250219-v1:0
3155
region us-west-2
32-
family llama3
33-
model meta.llama3-1-70b-instruct-v1:0
3456
```
3557

3658
**For OpenAI**, `~/.netrc` config is
3759
```
3860
machine chatter1
39-
provider openai
40-
host https://api.openai.com
61+
provider provider:openai/foundation/gpt
4162
model gpt-4o
63+
host https://api.openai.com
4264
secret sk-...IA
4365
```
4466

4567
**For LM Studio**, `~/.netrc` config is
4668
```
4769
machine chatter1
48-
provider openai
49-
host http://localhost:1234
70+
provider provider:openai/foundation/gpt
5071
model gemma-3-27b-it
72+
host http://localhost:1234
73+
timeout 300
5174
```

0 commit comments

Comments
 (0)