Metadata-Version: 2.4
Name: fastllm-claude-code
Version: 0.0.13
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.50
Requires-Dist: fastclaude>=0.0.4
Requires-Dist: fasttransport>=0.0.2
Dynamic: license-file

# fastllm-claude-code


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

This FastLLM provider runs models through an authenticated Claude Code CLI using [fastclaude](https://github.com/AnswerDotAI/fastclaude). Ordinary streaming and non-streaming FastLLM calls work as with any provider, and so do client-owned tool loops: FastLLM replays canonical history after each tool round, and fastclaude continues it in a fresh process.

## Usage

### Installation

Install latest from the GitHub [repository](https://github.com/AnswerDotAI/fastllm-claude-code):

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

or from [conda](https://anaconda.org/AnswerDotAI/fastllm-claude-code)

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

or from [pypi](https://pypi.org/project/fastllm-claude-code/)

``` sh
$ pip install fastllm_claude_code
```

### Documentation

Documentation can be found hosted on this GitHub [repository](https://github.com/AnswerDotAI/fastllm-claude-code)’s [pages](https://AnswerDotAI.github.io/fastllm-claude-code/). Additionally you can find package manager specific guidelines on [conda](https://anaconda.org/AnswerDotAI/fastllm-claude-code) and [pypi](https://pypi.org/project/fastllm-claude-code/) respectively.

## 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.

A normal FastLLM call uses the provider prefix:

``` 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 them and call again with the history extended by their results, as with any completions provider. fastclaude continues that history in a fresh process, so no response id is issued and nothing is held between calls:

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

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

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