sigoden / aichat

All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI tools & agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.
Apache License 2.0
4.23k stars 290 forks source link

Support amazon bedrock models? #300

Closed psanford closed 9 months ago

psanford commented 9 months ago

Please confirm whether the following requirements are met:

Tip: If the API of the new model is compatible with OpenAI's API, it can be used through localai client.

Please provide the following documents or links:

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html

sigoden commented 9 months ago

Many models in amazon-bedrock do not support context-aware conversations by appending an array of past messages. Different models have different request bodies, which is difficult to implement.

So I will not support amazon bedrock models.

But you can use amazon-bedrock with litellm.

$ litellm --model bedrock/anthropic.claude-v2

- Configure aichat to use it (note the ollama/ prefix on the model name):
```yaml
- type: openai-compatible
  name: calude
  api_base: http://localhost:8000/v1
  api_key: xxx
  models:
    - name: bedrock/anthropic.claude-v2