mistral_common.experimental.app.main
cli()
create_app(tokenizer, validation_mode=ValidationMode.test, engine_url='127.0.0.1', engine_backend=EngineBackend.llama_cpp, timeout=60)
Create a Mistral-common FastAPI app with the given tokenizer and validation mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tokenizer
|
Union[str, Path, MistralTokenizer]
|
The tokenizer path or a MistralTokenizer instance. |
required |
validation_mode
|
ValidationMode
|
The validation mode to use. |
test
|
engine_url
|
str
|
The URL of the engine API. |
'127.0.0.1'
|
timeout
|
int
|
The timeout of the engine API. |
60
|
Returns:
Type | Description |
---|---|
FastAPI
|
The Mistral-common FastAPI app. |
Source code in src/mistral_common/experimental/app/main.py
serve(tokenizer_path, validation_mode=ValidationMode.test, host='127.0.0.1', port=0, engine_url='http://127.0.0.1:8080', engine_backend=EngineBackend.llama_cpp.value, timeout=60)
Serve the Mistral-common API with the given tokenizer path and validation mode.