Metadata-Version: 2.4
Name: fastllm-claude-code
Version: 0.0.16
Summary: Claude Code API for fastllm
Author-email: Kerem Turgutlu <keremturgutlu@gmail.com>
License: Apache-2.0
Project-URL: Repository, https://github.com/AnswerDotAI/fastllm-claude-code
Project-URL: Documentation, https://AnswerDotAI.github.io/fastllm-claude-code/
Keywords: nbdev
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-fastllm>=0.0.62
Requires-Dist: fastclaude>=0.0.6
Requires-Dist: fasttransport>=0.0.2
Dynamic: license-file

# fastllm-claude-code


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

Use an authenticated Claude Code CLI as a [FastLLM](https://github.com/AnswerDotAI/fastllm) provider. The adapter runs models through [fastclaude](https://github.com/AnswerDotAI/fastclaude) and supports streaming, non-streaming calls, and client-owned tool loops.

Your application executes tool requests and supplies the results in the next call. FastLLM replays canonical history after each tool round. fastclaude continues that history in a fresh process.

## Usage

### Installation

Install from PyPI:

``` sh
pip install fastllm_claude_code
```

Or install from conda:

``` sh
conda install -c AnswerDotAI fastllm_claude_code
```

For the latest source version:

``` sh
pip install git+https://github.com/AnswerDotAI/fastllm-claude-code.git
```

### Documentation

See the [API documentation](https://AnswerDotAI.github.io/fastllm-claude-code/) and [source repository](https://github.com/AnswerDotAI/fastllm-claude-code). Package listings are on [PyPI](https://pypi.org/project/fastllm-claude-code/) and [conda](https://anaconda.org/AnswerDotAI/fastllm-claude-code).

## How to use

Installing the package registers the `claude_code` transport through FastLLM’s provider entry point. The Claude CLI must already be installed and authenticated for the current user.

Use the provider prefix in a FastLLM call:

``` python
from fastllm.acomplete import acomplete

answer = await acomplete('Answer briefly: what is 2+2?', model='claude_code/claude-sonnet-5')
```

For a client-owned tool loop, pass standard Responses API or Chat Completions function schemas. A response containing tool calls ends the turn. Execute the requests in your application, extend the history with their results, and call again.

Calls do not return a response id. Supply complete history each time and reuse `prompt_cache_key` to retain Claude’s account-context reminders:

``` python
first = await acomplete(messages, model='claude_code/claude-sonnet-5', tools=tools, prompt_cache_key='my-dialog')
assert first.tool_calls and first.response_id is None

final = await acomplete(messages_with_results, model='claude_code/claude-sonnet-5', tools=tools, prompt_cache_key='my-dialog')
```

Set `stream=True` for FastLLM’s normalized async stream. Non-streaming calls collect the same stream into one `Completion`. The adapter never executes tool requests.
